2021-07-30 18:18:04 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2021-08-12 22:12:04 +00:00
|
|
|
<GameControls />
|
|
|
|
<EngineDebug />
|
2021-08-13 20:39:49 +00:00
|
|
|
<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>
|
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>
|