/** The ninja can activate the objects either by clicking or by dragging. This example solution uses dragging. Decomposition: * variable created to count supplies * */ //****************Scene Object: Initialize When Scene Starts Event***************// $this.totalSupplies = 0; //******************Scene Object: Update Every Frame Event***********************// if ($this.totalSupplies >= 4) { //animate on ship sprite spaceShip.animation("thrust"); spaceShip.incrementAnimation(); rocket.moveY(-100); } //***************supply_1 Object: Mouse Button Up Event*************************// if($this.isTouching(rocket)) { $this.scene.totalSupplies += 1; $this.remove(); } else { //return to original position $this.x(44); $this.y(436); } //***********************supply_2 Object: Mouse Button Up Event*******************// if($this.isTouching(rocket)) { $this.scene.totalSupplies += 1; $this.remove(); } else { //return to original position $this.x(182); $this.y(412); } //**********************supply_3 Object: Mouse Button Up Event*******************// if($this.isTouching(rocket)) { $this.scene.totalSupplies += 1; $this.remove(); } else { //return to original position $this.x(254); $this.y(446); } //************************supply_4 Object: Mouse Button Up Event*******************// if($this.isTouching(rocket)) { $this.scene.totalSupplies += 1; $this.remove(); } else { //return to original position $this.x(374); $this.y(444); }