소스 검색

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;