Browse Source

Add Ninja Supplies

Michael Tang 3 năm trước cách đây
mục cha
commit
b638b7363a
1 tập tin đã thay đổi với 12 bổ sung0 xóa
  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); 
+}