Michael Tang 1 год назад
Родитель
Сommit
cb84b1ddcf
1 измененных файлов с 3 добавлено и 1 удалено
  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