Quote:
Originally Posted by AllaboutGT
hello all i am doing a project making a game: "save the lunch lady"
Basically everytime i click on the object (a ninja) one tray is suppose to appear at a time. click again another tray appears, until 5 trays total have appeared.
I cant give a condition where one tray will appear when i click on the object once! I've tried everything and nothing is working. Everytime i click on the object (a ninja) either all 5 trays appear one right after the other, or just im just able to get the first tray to appear.
How do i get the tray to appear one at a time, each time I click of the same object!?!?
so annoyed been doing this for days and finished everything else just cant get this last step! and the teacher cant figure it out too! she just tells me to keep trying, but the project will be due soon and i cant find help from anyone
Pls help thanks!
|
what you need is a counter variable to keep track of how many times you've clicked on the ninja. Then in your checkIfNinja function you need to add some extra checks. Something like
if counter == 1 then
set opacity of first tray to 100%
if counter == 2 then
set opacity of second tray to 100%
etc
Also you could simplify the event to use
When mouse is clicked on Ninja (instead of anything)
This will in turn simplify your checkIfNinja function (since you will no longer need to check, you just need to increment the counter and show the next tray)
For video tutorials on programming in Alice 2.2 check out my YouTube channel
http://www.youtube.com/user/drdave785
Also check out my Programming in Alice blog at
http://programminginalice.com