knowyt/client/src/pages/play.vue
2021-08-13 22:39:49 +02:00

35 lines
618 B
Vue

<template>
<div>
<GameControls />
<EngineDebug />
<div v-if="gameState === 'idle'">
<p>waiting ...</p>
</div>
<div v-if="gameState === 'ready-set'">
<h1>{{ gamePhase }}</h1>
</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>