Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 216 bytes modified

beta.r3js.org
-=yb4f310 2018-03-24 21:52:52 +01:00
parent ef2d36ef43
commit 59220f669a
1 changed files with 17 additions and 1 deletions

View File

@ -913,14 +913,30 @@ GameLib.CustomCode.prototype.createFood = function(delta) {
GameLib.CustomCode.prototype.gameOver = function(won) { GameLib.CustomCode.prototype.gameOver = function(won) {
this.state.gameOver = true; this.state.gameOver = true;
if (won) { if (won) {
GameLib.Event.Emit(
GameLib.Event.PLAY_AUDIO,
{
name : 'Audio - Game Over Won'
}
);
this.state.message = { this.state.message = {
text: "YOU WON!", text: "YOU WON!",
x: 152, x: 152,
y: 256 y: 256
}; };
} else { } else {
GameLib.Event.Emit(
GameLib.Event.PLAY_AUDIO,
{
name : 'Audio - Game Over Lost'
}
);
this.state.message = { this.state.message = {
text: "GAME OVER", text: "GAME OVER",
x: 127, x: 127,