- Rename and restructure components and assets for uniformity.
- Refactor `Field.vue` for better state management and event handling. - Update path references for SVG assets. - Add selection highlighting in game field with red and white arrows. - Simplify and organize styles in game components. - Minor updates to local mode game logic (`LocalMode.vue`).
This commit is contained in:
@@ -1,20 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import Field from '@/components/Game/Field.vue';
|
||||
import Field from '@/components/game/Field.vue'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const gameField = [
|
||||
[0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 2, 1],
|
||||
[1, 0, 0, 0, 0, 1, 1],
|
||||
[1, 0, 2, 0, 1, 2, 2],
|
||||
[1, 1, 2, 1, 2, 1, 2],
|
||||
];
|
||||
let gameField = [
|
||||
[0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 2, 1],
|
||||
[1, 0, 1, 0, 0, 1, 1],
|
||||
[1, 0, 2, 0, 1, 2, 2],
|
||||
[1, 1, 2, 1, 2, 1, 2],
|
||||
]
|
||||
|
||||
let currentSelection = ref(null)
|
||||
|
||||
setInterval(() => {
|
||||
console.log(currentSelection.value)
|
||||
}, 1000)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Field :game-state="gameField"></Field>
|
||||
<Field :game-state="gameField" v-model:current-selection-index="currentSelection" ></Field>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
<style scoped></style>
|
||||
Reference in New Issue
Block a user