Update game.html
Browse files
game.html
CHANGED
|
@@ -109,7 +109,10 @@ function create ()
|
|
| 109 |
function update ()
|
| 110 |
{
|
| 111 |
if (gameOver)
|
| 112 |
-
{
|
|
|
|
|
|
|
|
|
|
| 113 |
return;
|
| 114 |
}
|
| 115 |
if (cursors.left.isDown)
|
|
@@ -158,13 +161,7 @@ function hitBomb (player, bomb)
|
|
| 158 |
this.physics.pause();
|
| 159 |
player.setTint(0xff0000);
|
| 160 |
player.anims.play('turn');
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
var mainCamera = this.cameras.main
|
| 164 |
-
mainCamera.shake(250);
|
| 165 |
-
mainCamera.fadeOut(3000);
|
| 166 |
-
sleep(2000);
|
| 167 |
-
this.scene.restart();
|
| 168 |
}
|
| 169 |
</script>
|
| 170 |
<div>
|
|
|
|
| 109 |
function update ()
|
| 110 |
{
|
| 111 |
if (gameOver)
|
| 112 |
+
{ var mainCamera = this.cameras.main
|
| 113 |
+
mainCamera.shake(250);
|
| 114 |
+
mainCamera.fadeOut(3000);
|
| 115 |
+
this.scene.restart();
|
| 116 |
return;
|
| 117 |
}
|
| 118 |
if (cursors.left.isDown)
|
|
|
|
| 161 |
this.physics.pause();
|
| 162 |
player.setTint(0xff0000);
|
| 163 |
player.anims.play('turn');
|
| 164 |
+
gameOver = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
}
|
| 166 |
</script>
|
| 167 |
<div>
|