Przeglądaj źródła

Fix Endless run ninja object

Michael Tang 3 lat temu
rodzic
commit
0c21be0dfe
2 zmienionych plików z 6 dodań i 1 usunięć
  1. BIN
      .DS_Store
  2. 6 1
      03-orange/12-PY-endless-run.js

BIN
.DS_Store


+ 6 - 1
03-orange/12-PY-endless-run.js

@@ -107,7 +107,12 @@ if (spaceIsPressed && !ninja.isJumping) {
     ninja.isJumping = true; 
 }
 
-//********************ninja Object - Initialize When Scene Starts*******************//
+//*****************ninja Object - Initialize When Scene Starts Event*****************//
+
+$this.velocityY = 0;
+$this.isJumping = false;
+
+//********************ninja Object - Update Every Frame Event***********************//
 $this.incrementAnimation();
 
 // if the ninja is jumping