knowyt/client/src/pages/play.vue

33 lines
624 B
Vue
Raw Normal View History

2021-07-30 18:18:04 +00:00
<template>
<div>
2021-08-12 22:12:04 +00:00
<GameControls />
<EngineDebug />
2021-08-13 21:02:44 +00:00
<ReadySet v-if="gameState === 'ready-set'" :text="gamePhase" />
2021-08-14 12:39:16 +00:00
<template v-if="gameState === 'idle'">
2021-08-13 21:02:44 +00:00
<ReadySet text="waiting ..." />
2021-08-14 12:39:16 +00:00
</template>
2021-08-13 20:39:49 +00:00
<div v-if="gameState === 'play'">
<h2>Play</h2>
</div>
2021-07-30 18:18:04 +00:00
</div>
</template>
<script>
export default {
2021-08-05 00:22:28 +00:00
async mounted() {
await this.$engine.start()
2021-07-30 18:18:04 +00:00
},
2021-08-12 21:08:17 +00:00
async beforeDestroy() {
await this.$engine.stop()
},
2021-08-13 20:39:49 +00:00
computed: {
gameState() {
return this.$store.state.game.state
},
gamePhase() {
return this.$store.state.game.phase
},
},
2021-07-30 18:18:04 +00:00
}
</script>