03-04-ninja-supplies.js 402 B

123456789101112
  1. //Multiple toggle effects and mouse click events
  2. //so game could be buggy
  3. //Sword Object - Mouse Button Up Event
  4. if ($this.isTouching(ninja)) {
  5. $this.remove(); // remove the original sword
  6. star.toggleDraggable(); // make the star draggable
  7. swordIcon.toggleVisible(); // makes the sword icon visible
  8. } else {
  9. // otherwise, return sword to pile.
  10. $this.x(672); $this.y(314);
  11. }