Counter Question
How would I go about making a counter stop, so that if I was to create a simple game for a young child, if they clicked on say a cow more than once, the counter would go up, but stop after multiple clicks?
|
Well you would use an if statement and say something like:
[CODE] if(world.counter<=some number) { increment world.counter by one(world.counter++) } else { //Whatever you want it to do. }[/CODE] |
So, theroretically, I could have it go up to 1, if they clicked on the cow once, then if they tried to again, and say the new object is a chicken, it wouldn't go up?
|
Yes, you could do this as well, however you would have to create two different "when the mouse is clicked on....." events both of which must call the same method.
|
All times are GMT -5. The time now is 05:06 AM. |
Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.