Skip to content

Commit

Permalink
j
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Jaeger authored and Simon Jaeger committed Oct 22, 2022
1 parent 0cb3545 commit 17f1c98
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
4 changes: 3 additions & 1 deletion components/GameView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
</script>

<template>
<div class="grid"></div>
<ul>
<li v-for="obst of robo._level.obstacles">{{ obst }}</li>
</ul>
</template>
27 changes: 16 additions & 11 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,28 @@
import {Robot} from "~/classes/Robot"
import {Level} from "~/classes/Level"
import Counter from "~/components/Counter.vue"
import GameView from "~/components/GameView.vue"
const level = new Level({obstacles: new Set([2, 4, 8])})
const Robo = new Robot({level})
const robo = new Robot({level})
</script>

<template>
<main>
<h1 class="font-mono">pixel</h1>
<h2>normal</h2>
<pre>{{ JSON.stringify(Robo, null, 2) }}</pre>
<pre>obstacles: {{ [...level.obstacles].join(",") }}</pre>
<div class="w-96 h-32 bg-black relative">
<div
class="w-8 h-8 bg-gray-500 absolute"
:style="{left: (Robo._x * 32)+'px', bottom: (Robo._y * 32)+'px'}"
></div>
</div>
<GameView :robo="robo"/>
<!-- <ul>-->
<!-- <li v-for="obst of Robo._level.obstacles">x</li>-->
<!-- </ul>-->
<!-- <h1 class="font-mono">pixel</h1>-->
<!-- <h2>normal</h2>-->
<!-- <pre>{{ JSON.stringify(Robo, null, 2) }}</pre>-->
<!-- <pre>obstacles: {{ [...level.obstacles].join(",") }}</pre>-->
<!-- <div class="w-96 h-32 bg-black relative">-->
<!-- <div-->
<!-- class="w-8 h-8 bg-gray-500 absolute"-->
<!-- :style="{left: (Robo._x * 32)+'px', bottom: (Robo._y * 32)+'px'}"-->
<!-- ></div>-->
<!-- </div>-->
</main>
</template>

0 comments on commit 17f1c98

Please sign in to comment.