Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Thread Tools Display Modes
Counter for missed objects
Posts: n/a
Question Counter for missed objects - 11-08-2009, 12:12 PM

I am working through Chapter 5, and our assignment is a continuation of a game we built last week using a cone to catch a torus as it falls. This time we needed to add additional torus objects and keep track of how many are caught as well as how many were missed.

My score for how many are caught seems to work fine, but I can not figure out why my score for how many missed is not counting all of them. I am using if/then statements checking each torus object for it's proximity to the cone as well as it's proximity to the ground, so it does not count a missed torus that did not fall.

I noticed that in the first few rounds, when just 1 torus falls, it will count it as missed if it moves to the right as it falls, but not if it moves to the left as it falls.

If anyone can tell me where my logic is wrong, it would be very helpful. FYI, this assignment also required us to use an array for the torus objects.
Attached Files
File Type: a2w Lab4.a2w (404.5 KB, 20 views)
Reply With Quote

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 ©2021, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.