Переглянути джерело

Fix Candy Sort to randomize color at IWSS event

Michael Tang 3 роки тому
батько
коміт
7a62039183
1 змінених файлів з 11 додано та 0 видалено
  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;