|
|
@@ -1,4 +1,6 @@
|
|
|
//meteor - Update Every Frame
|
|
|
+//Code below is given up to the next comment where ninjas add to code to "make the game more interesting"
|
|
|
+//Should also talk about where in the game the score is being added.
|
|
|
moveX($this);
|
|
|
moveY($this);
|
|
|
|
|
|
@@ -18,6 +20,9 @@ if(bullet && $this.isTouching(bullet)){
|
|
|
score.text("Score: "+$this.scene.scoreValue);
|
|
|
//this is where you add the code in step 3, inside the if ($this.isTouching(bullet)) statement
|
|
|
//Good place to have ninja explain what this code is doing
|
|
|
+ //Review conditionals and comparison operators
|
|
|
+ //Remember that this section is all about Math
|
|
|
+ //Draw the connections between math and computer science - math is definitely important in game dev!
|
|
|
if (this.scaleX() >= 0.25) {
|
|
|
var ncircle = $this.clone();
|
|
|
ncircle.x($this.x()+100);
|
|
|
@@ -25,7 +30,10 @@ if(bullet && $this.isTouching(bullet)){
|
|
|
$this.remove();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+//Ask the ninja what this code is doing
|
|
|
+//It is given to us but we should know what it is doing.
|
|
|
+//They've seen this code in Hungry Ninja,
|
|
|
+//The follow code resets the position of the meteor when he flies off the screen.
|
|
|
if($this.y()>700){
|
|
|
$this.y(0);
|
|
|
}
|