Explorar el Código

Fix Candy Sort to randomize color at IWSS event

Michael Tang hace 3 años
padre
commit
7a62039183
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  1. 11 0
      02-yellow/04-08-PY-candy-sort.js

+ 11 - 0
02-yellow/04-08-PY-candy-sort.js

@@ -20,6 +20,17 @@ Decomposition
 $this.totalScore = 0;
 //Create variable to compare binColor with candyColor
 $this.binColor = 0;
+if ($this.scene.state() = "PLAY") {
+    createTimer(2000, function() {
+        var candyColor = random(2);
+        var nCandy = candy.clone();
+        nCandy.color = candyColor;
+        nCandy.frameIndex(candyColor);
+        nCandy.x(58) = 
+        nCandy.y(154) = 
+        
+    });
+}
 //boolean used to check which arrow is pressed
 bins.keyDown = false;