Browse Source

pass step 5

Michael Tang 1 năm trước cách đây
mục cha
commit
cb84b1ddcf
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      orange/L6-build-shooting-hoops.js

+ 3 - 1
orange/L6-build-shooting-hoops.js

@@ -32,7 +32,9 @@ ballSprite.setPosition(randint(10, screen.width - 10), playerSprite.y)
 
 // game mechanics
 forever(function () {
-	
+    if (playerSprite.overlapsWith(ballSprite) && controller.A.isPressed()) {
+        ballSprite.follow(hoopSprite, randint(50, 100))
+    }
 })
 
 // on countdown end