Alice Community Need help with the score board in Rings game

 Need help with the score board in Rings game
lucyrn99
Member

Status: Offline
Posts: 23
Join Date: Aug 2016
Location: Dallas TX
Need help with the score board in Rings game - 11-13-2016, 02:43 PM

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
Attached Files
 Lab3-LP.a2w (312.7 KB, 4 views)

 MrMoke Senior Member     Status: Offline Posts: 501 Join Date: Sep 2007 Location: Austin, Texas 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 did add the call then: 2) The main method starts with an infinite loop that starts with the torus falling from the sky. (Problem: 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... Last edited by MrMoke; 11-13-2016 at 08:07 PM.
 Still can't figure out scoring
lucyrn99
Member

Status: Offline
Posts: 23
Join Date: Aug 2016
Location: Dallas TX
Still can't figure out scoring - 11-14-2016, 11:53 PM

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!
Attached Files
 Lab3-LP.a2w (313.2 KB, 1 views)

chickentree
Super Moderator

Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
11-15-2016, 12:20 AM

Quote:
 Originally Posted by lucyrn99 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!
Suggestion:
Try using "print" (along bottom with loop, do in order etc) to print out the distance between the torus and the cone.

Mark Henwood
mhenwood@ieee.org

 Still Buggy
MrMoke
Senior Member

Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Still Buggy - 11-15-2016, 07:38 AM

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.
Attached Files
 Lab3-LP2.a2w (314.0 KB, 3 views)

Last edited by MrMoke; 11-15-2016 at 06:09 PM.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops General Discussion     Questions and Comments     The Lounge