fix: snake only spawn after game start

This commit is contained in:
Renge 2022-04-25 22:54:26 -04:00
parent 8353ee74ef
commit 5e08a7b3aa

View File

@ -28,7 +28,7 @@ export default class Tutorial extends GameLevel {
super.updateScene(deltaT);
//spawn snake()
if(Math.random() < .0001){
if(Math.random() < .0001 && this.gameStarted){
console.log("RANDOM SNAKE!");
this.addEnemy("Snake", this.player.position.clone().add(new Vec2(0,-320)), SnakeAI, {
player: this.player,