Skip to content

Commit

Permalink
adds phaser container component
Browse files Browse the repository at this point in the history
  • Loading branch information
ceceliacreates committed Sep 5, 2023
1 parent c6192d5 commit ca9586f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
37 changes: 37 additions & 0 deletions src/components/PhaserContainer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>
<div id="game">
<ion-button v-if="showButton" @click="handleClickStart">Start</ion-button>
</div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { IonButton } from '@ionic/vue';
import { Game} from 'phaser';
// binds to the v-if on our button to toggle visibility
const showButton = ref(true)
// Creates the new Phaser Game instance
function launch() {
// We'll fill this in later
}
function handleClickStart() {
// hides launch button
showButton.value = false;
// Runs the launch function
launch();
}
</script>

<style scoped>
#game {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
}
</style>
5 changes: 2 additions & 3 deletions src/views/PlayPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
<ion-title size="large">Play</ion-title>
</ion-toolbar>
</ion-header>

<ExploreContainer name="Play page" />
<PhaserContainer/>
</ion-content>
</ion-page>
</template>

<script setup lang="ts">
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent } from '@ionic/vue';
import ExploreContainer from '@/components/ExploreContainer.vue';
import PhaserContainer from '@/components/PhaserContainer.vue';
</script>

0 comments on commit ca9586f

Please sign in to comment.