Parcourir la source

Add Ninja Supplies

Michael Tang il y a 3 ans
Parent
commit
b638b7363a
1 fichiers modifiés avec 12 ajouts et 0 suppressions
  1. 12 0
      02-yellow/03-04-ninja-supplies.js

+ 12 - 0
02-yellow/03-04-ninja-supplies.js

@@ -0,0 +1,12 @@
+//Multiple toggle effects and mouse click events 
+//so game could be buggy
+
+//Sword Object - Mouse Button Up Event
+if ($this.isTouching(ninja)) { 
+    $this.remove(); // remove the original sword 
+    star.toggleDraggable(); // make the star draggable 
+    swordIcon.toggleVisible(); // makes the sword icon visible 
+} else { 
+    // otherwise, return sword to pile. 
+    $this.x(672); $this.y(314); 
+}