knowyt/client/src/pages/play.vue
2021-08-13 23:02:44 +02:00

33 lines
614 B
Vue

<template>
<div>
<GameControls />
<EngineDebug />
<ReadySet v-if="gameState === 'ready-set'" :text="gamePhase" />
<div v-if="gameState === 'idle'">
<ReadySet text="waiting ..." />
</div>
<div v-if="gameState === 'play'">
<h2>Play</h2>
</div>
</div>
</template>
<script>
export default {
async mounted() {
await this.$engine.start()
},
async beforeDestroy() {
await this.$engine.stop()
},
computed: {
gameState() {
return this.$store.state.game.state
},
gamePhase() {
return this.$store.state.game.phase
},
},
}
</script>