Alice Community (http://www.alice.org/community/index.php)
-   The Lounge (http://www.alice.org/community/forumdisplay.php?f=4)
-   -   Need help with the score board in Rings game (http://www.alice.org/community/showthread.php?t=11634)

 lucyrn99 11-13-2016 02:43 PM

Need help with the score board in Rings game

1 Attachment(s)
Hi everyone,

Our assignment is to create a game where a ring drops out of the sky, and the user has to move a cone under the ring, in order to catch it.

The user gets 1 point for each time he/she catches a ring with the cone.
This should repeat/loop 10 times, at which point the game should end.

My difficulty has been with trying to get the scoring to work properly.

I have watched a bunch of youtube videos to learn how to set up the scoring, and have created the numerical variables to designate that the goal of the game is a score = 10. I'm still obviously missing some crucial connection, though, because the scoring is not working at all.

Lucy

 MrMoke 11-13-2016 08:04 PM

Hi Lucy- Gosh. There are numerous problems. This is a tough game because in a 3D environment it's often hard to see how to move the cone to the actual drop point. Camera placement is probably critical.

1) The cone isn't really on the ground, so you have no real way to judge the distance. It's actually floating in the air.
2) Next note the center point of the cone is in the middle not the base while the center of the torus in the center of the circle. The distance is measured between those two points.
3) Those two problems mean, you have no way of telling whether the drop distance is even close to the .1 you are checking for.

Now for the code--
1) When you click on the instructions you make them disappear, but never call the main method, so nothing happens.

If you [U]did[/U] add the call then:

2) The main method starts with an infinite loop that starts with the torus falling from the sky. ([U]Problem[/U]: That turns out to be a loop that moves the torus down 10 times before it stops, so the torus has moved down 27 meters before the check is done.)
3) The first loop is infinite, so the second infinite loop is never reached. The first one just keeps pushing the torus down 27 meters at a time.
4) Lastly, nothing in the program actually moves the torus back up to a random starting position.

Lot of work to do...;)

 lucyrn99 11-14-2016 11:53 PM

Still can't figure out scoring

1 Attachment(s)
Hi Mr. Moke,

I apologize.. I should have clarified that I wanted assistance just with the score-keeping part of the game, not with any of the other parts.

I had attached my (very messy and not audience-ready) code with the intent that you'd get a general sense of the scoring that needed to be tallied.

Thank you for your feedback. I'm still not seeing the score increment as I would expect it to, when the torus is close to the cone.
I understand your comment about the center of the cone being its middle, therefore I've allowed some extra cushion (.5 meters' worth) to compensate for that. However, it still doesn't work properly to add 1 to the score when the torus and cone are within close proximity.

Please see attached (cleaned-up version). Thank you for your interest and help!

 chickentree 11-15-2016 12:20 AM

[QUOTE=lucyrn99;57418]Hi Mr. Moke,

I apologize.. I should have clarified that I wanted assistance just with the score-keeping part of the game, not with any of the other parts.

I had attached my (very messy and not audience-ready) code with the intent that you'd get a general sense of the scoring that needed to be tallied.

Thank you for your feedback. I'm still not seeing the score increment as I would expect it to, when the torus is close to the cone.
I understand your comment about the center of the cone being its middle, therefore I've allowed some extra cushion (.5 meters' worth) to compensate for that. However, it still doesn't work properly to add 1 to the score when the torus and cone are within close proximity.

Please see attached (cleaned-up version). Thank you for your interest and help![/QUOTE]
Suggestion:
Try using "print" (along bottom with loop, do in order etc) to print out the distance between the torus and the cone.

 MrMoke 11-15-2016 07:38 AM

Still Buggy

1 Attachment(s)
Mark is correct in recommending the use of print statements for troubleshooting. Try this slightly modified version that demonstrates some of the logic problems that you still have in place.

 All times are GMT -5. The time now is 04:50 PM.