Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
Need help with the score board in Rings game
Old
lucyrn99
Member
 
Status: Offline
Posts: 23
Join Date: Aug 2016
Location: Dallas TX
Default 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.

Thanks in advance for any advice, and my code is attached for your review/critique.

Lucy
Attached Files
File Type: a2w Lab3-LP.a2w (312.7 KB, 4 views)
   
Reply With Quote
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default 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.
   
Reply With Quote
Still can't figure out scoring
Old
lucyrn99
Member
 
Status: Offline
Posts: 23
Join Date: Aug 2016
Location: Dallas TX
Default 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
File Type: a2w Lab3-LP.a2w (313.2 KB, 1 views)
   
Reply With Quote
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default 11-15-2016, 12:20 AM

Quote:
Originally Posted by lucyrn99 View Post
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
   
Reply With Quote
Still Buggy
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default 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
File Type: a2w Lab3-LP2.a2w (314.0 KB, 3 views)

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

Thread Tools
Display Modes

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 Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.