Skip to content
Snippets Groups Projects
Commit 8f66e018 authored by Paolo.Brasolin's avatar Paolo.Brasolin
Browse files

feat: #fe make game more discoverable

parent f74b9169
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,9 @@ export default class PauseScene extends Phaser.Scene { ...@@ -39,7 +39,9 @@ export default class PauseScene extends Phaser.Scene {
} }
drawCTA() { drawCTA() {
const text = "TAKE A BREATH"; const text = this.game.device.os.desktop
? " TAKE A BREATH\nESC key to resume"
: "TAKE A BREATH\ntap to resume";
const title = this.add.text(0, 0, text, { const title = this.add.text(0, 0, text, {
font: "bold 24px Courier", font: "bold 24px Courier",
color: "#ffffff", color: "#ffffff",
...@@ -47,7 +49,7 @@ export default class PauseScene extends Phaser.Scene { ...@@ -47,7 +49,7 @@ export default class PauseScene extends Phaser.Scene {
title.setOrigin(0.5, 0.5); title.setOrigin(0.5, 0.5);
title.setPosition( title.setPosition(
this.cameras.main.width * 0.5, this.cameras.main.width * 0.5,
this.cameras.main.height * 0.5, this.cameras.main.height * 0.6,
); );
} }
......
...@@ -26,7 +26,9 @@ export default class WelcomeScene extends Phaser.Scene { ...@@ -26,7 +26,9 @@ export default class WelcomeScene extends Phaser.Scene {
} }
drawCTA() { drawCTA() {
const text = "press to start"; const text = this.game.device.os.desktop
? "any key to begin\nESC key to pause\n TYPE ALL WORDS"
: " tap to begin\n tap to pause\nTYPE ALL WORDS";
const cta = this.add.text(0, 0, text, { const cta = this.add.text(0, 0, text, {
font: "bold 32px Courier", font: "bold 32px Courier",
color: "#ffffff", color: "#ffffff",
...@@ -52,8 +54,11 @@ export default class WelcomeScene extends Phaser.Scene { ...@@ -52,8 +54,11 @@ export default class WelcomeScene extends Phaser.Scene {
} }
bindEvents() { bindEvents() {
this.input.keyboard.once("keyup", this.startFight.bind(this)); if (this.game.device.os.desktop) {
this.input.once("pointerup", this.startFight.bind(this)); this.input.keyboard.once("keyup", this.startFight.bind(this));
} else {
this.input.once("pointerup", this.startFight.bind(this));
}
} }
startFight() { startFight() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment