// Setting the Scene // Common error is that ninjas add the asset to an existing asset thereby creating a unintended group. // Teach ninjas to always go back to the scene before pressing the add asset button. // It's very easy for ninjas to neglect to set roles or speedX, or other properties because they are only looking // at pictures in the manual. When reading carefully, they should notice that the manual // asks SpeedX, roles, and positions (x,y, z) are provided for every object // background z 0 // rooftop z 1 // runner z 5 (higher than rooftops) ensures that it shows up on top //**************************** rooftop1 - Update Every Frame ********************************/ // rooftop is always moving // ensure speedX is set to -200 $this.moveX(); if($this.x() <= -800) { $this.x(1200); $this.y(random(550,300)); } //*************************** rooftop1 - Initialize When Scene Starts ***********************/ // sets initial rooftop x and randomizes y (height) $this.x(0); $this.y(random(550, 300)); //*************************** rooftop2 - Update When Scene Starts ***************************/