Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 216 bytes modified
parent
ef2d36ef43
commit
59220f669a
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue