-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/teach-a-bot-hack-basel/teac…
- Loading branch information
Showing
3 changed files
with
50 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
<script lang="ts" setup> | ||
import GameView from "~/components/GameView.vue" | ||
import Controller from "~/components/Controller.vue" | ||
import {Robot} from "~/classes/Robot" | ||
import {Level} from "~/classes/Level" | ||
import {watchEffect} from "#imports" | ||
import {useRouter} from "#app" | ||
import GameView from "~/components/GameView.vue" | ||
import Controller from "~/components/Controller.vue" | ||
import {Robot} from "~/classes/Robot" | ||
import {Level} from "~/classes/Level" | ||
import {watchEffect} from "#imports" | ||
import {useRouter} from "#app" | ||
const router = useRouter() | ||
const level = new Level({obstacles: new Set([3, 6, 10]), goal: 2}) | ||
const robo = new Robot({level}) | ||
const router = useRouter() | ||
const level = new Level({obstacles: new Set([3, 6, 10]), goal: 2}) | ||
const robo = new Robot({level}) | ||
watchEffect(() => { | ||
if (robo._x >= level.goal) { | ||
alert('goal reached!') | ||
router.push('/chapter/console/2') | ||
} | ||
}) | ||
watchEffect(() => { | ||
if (robo._x >= level.goal) { | ||
alert('goal reached!') | ||
router.push('/chapter/console/2') | ||
} | ||
}) | ||
</script> | ||
<template> | ||
<div class="flex flex-col aspect-square"> | ||
<GameView :robo="robo" class="flex-grow"/> | ||
<Controller :robo="robo" class="fixed bottom-0"/> | ||
<div class="flex flex-col aspect-square max-w-2xl mx-auto mt-10"> | ||
<div class="p-10 bg-gray-400"> | ||
<GameView | ||
:robo="robo" | ||
:resolution="12" | ||
/> | ||
<Controller | ||
:robo="robo" | ||
chapter-name="Methods" | ||
current-task="1" | ||
task-count="4" | ||
/> | ||
</div> | ||
</div> | ||
</template> |