From edb3738e2f505d9fb52e7f2ffe8e6018b108c2e9 Mon Sep 17 00:00:00 2001 From: nAtHanDang0703 <77898991+nAtHanDang0703@users.noreply.github.com> Date: Sat, 18 May 2024 01:14:16 -0700 Subject: [PATCH] Update BasketballStar.wp The was an issue regarding the basketball star game, where the player does not earn a score when the basketball is in the hoop. Furthermore, the player sometimes earns a score even if the basketball is not in the hoop. Through trial and error, I changed the range of the basketXPlace and included the y position of the basketball in consideration of the score, since the ball can sometimes drift away from the basket as it goes down. An issue I ran into was that sometimes, the score wouldn't go up if the ball touches the rim and rolls into the basket. --- static/examples/BasketballStar.wp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/examples/BasketballStar.wp b/static/examples/BasketballStar.wp index e4250586c..1d4aa961f 100644 --- a/static/examples/BasketballStar.wp +++ b/static/examples/BasketballStar.wp @@ -17,7 +17,8 @@ basketball: Phrase( basketXPlace: Random(-9000m 9000m) ÷ 1000 … (click & ((clickCount % 2) = 1)) … Random(-9000m 9000m) ÷ 1000 `` Keep track of scores and attempts `` -score: 0 … (click & ((clickCount % 2) = 1) & ((basketXPlace + 1m) > basketball.place.x) & ((basketXPlace - 1m) < basketball.place.x)) … 1 + . +score: 0 … (click & ((clickCount % 2) = 1) & ((basketXPlace + 0.81m) > basketball.place.x) & ((basketXPlace - 0.8m) < basketball.place.x)) & (2.1m > basketball.place.y) … 1 + . + attempt: (clickCount ÷ 2).roundUp() basketballStar: Group(Stack() [ @@ -38,4 +39,4 @@ Stage( ] place: Place(x: 0m y: 5m z: -10m) gravity: 5m/s^2 -) \ No newline at end of file +)