03-04-ninja-supplies.js 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. //Multiple toggle effects and mouse click events
  2. //so game could be buggy
  3. //Buggy on Brave Browser, use Chrome
  4. //***********Sword Object - Mouse Button Up Event************//
  5. if ($this.isTouching(ninja)) {
  6. $this.remove(); // remove the original sword
  7. star.toggleDraggable(); // make the star draggable
  8. swordIcon.toggleVisible(); // makes the sword icon visible
  9. } else {
  10. // otherwise, return sword to pile.
  11. $this.x(672); $this.y(314);
  12. }
  13. //********Star Object - Mouse Button Up Event***************//
  14. if ($this.isTouching(ninja)) {
  15. $this.remove(); // remove the original star
  16. staff.toggleDraggable(); // make the star draggable
  17. starIcon.toggleVisible(); // make the star icon visible
  18. } else {
  19. // otherwise, return the star to the pile
  20. $this.x(492); $this.y(372);
  21. }
  22. //**********Staff Object - Mouse Button Up Event************//
  23. if ($this.isTouching(ninja)) {
  24. $this.remove(); // remove the original staff
  25. staff.toggleDraggable(); // make the staff dragable
  26. staffIcon.toggleVisible(); // makes the staff icon visible
  27. } else {
  28. // otherwise, return the staff to the pile
  29. $this.x(650); $this.y(346);
  30. }