-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added minigame launch * added return to hospital * hospital placeholder * fixes * map minigames to correct hospitals and return to city in proper spot * must talk to doctor before minigame * allow stopping computer for multiple hospitals * add ugly minigame menu screen * fix minigame menu styling * connect spy zebra to hospital * link zebra catcher minigame * rename to iSpy and update script * remove check if doctor talked to * fix click to be anywhere not text --------- Co-authored-by: Owen Cooke <[email protected]>
- Loading branch information
1 parent
b98f360
commit 4969bdb
Showing
11 changed files
with
431 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { Scene } from "phaser"; | ||
|
||
const howToPlay = { | ||
TileJump: | ||
"Jump up to the next rising layer without falling! Use the left and right arrow keys to move horizontally, and press the spacebar or the up arrow key to jump.", | ||
Pong: "Keep the ball up using your head and to prevent the ball from hitting the ground. Move left and right using the arrow keys.", | ||
Maze: "Navigate through the maze to reach the zebra-striped goal. Use the arrow keys to move up, down, left, and right.", | ||
iSpy: `This exercise is simple: just spot the zebra! Use the mouse to click.\n\n PS: Did you know that the zebra is the symbol of rare diseases? Because When you hear hoofbeats behind you, you don't expect to see a zebra, similar to common rare disease diagnoses.`, | ||
ZebraCatcher: | ||
"Oh no, the zebras are falling from the sky! Catch them by moving your player with the left and right arrow keys. ", | ||
}; | ||
|
||
const textStyle = { | ||
fontSize: "24px", | ||
fill: "black", | ||
align: "center", | ||
fontFamily: "'Press Start 2P'", | ||
}; | ||
|
||
export class MinigameMenu extends Scene { | ||
constructor() { | ||
super("MinigameMenu"); | ||
} | ||
|
||
init(data) { | ||
this.minigame = data.minigame; | ||
} | ||
|
||
create() { | ||
// Background | ||
|
||
const background = this.add.image( | ||
this.cameras.main.width / 2, | ||
this.cameras.main.height / 2, | ||
"bg" | ||
); | ||
background.setDisplaySize( | ||
this.cameras.main.width, | ||
this.cameras.main.height | ||
); | ||
|
||
// Title text | ||
this.add | ||
.text( | ||
this.game.config.width / 2, | ||
this.game.config.height / 4, | ||
this.minigame, | ||
{ ...textStyle, fontSize: "48px" } | ||
) | ||
.setOrigin(0.5); | ||
|
||
// Instructions text | ||
this.add | ||
.text( | ||
this.game.config.width / 2, | ||
this.game.config.height / 2, | ||
howToPlay[this.minigame], | ||
{ | ||
...textStyle, | ||
wordWrap: { width: this.game.config.width - 100 }, | ||
} | ||
) | ||
.setOrigin(0.5); | ||
|
||
// Click to start text | ||
this.add | ||
.text( | ||
this.game.config.width / 2, | ||
(this.game.config.height * 3) / 4, | ||
"Click Anywhere or Press Spacebar to Start!", | ||
textStyle | ||
) | ||
.setOrigin(0.5); | ||
|
||
this.input.on("pointerdown", this.startGame, this); | ||
this.input.keyboard.on("keydown-SPACE", this.startGame, this); | ||
} | ||
|
||
startGame() { | ||
this.scene.start(this.minigame); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.