View Single Post
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default 01-11-2013, 09:34 PM

Some times it is good to outline what you want to do and then make the code follow your outline.
In the present case you initially start with all the trays opacity set to 0.2, for all practical purposes invisible. Each time the ninja is clicked on the opacity of the next tray should be changed to 1.0. So, for any particular click only one tray should change its opacity. This calls for a series of nested if statements. Each if clause will test one tray's opacity if it is 0.2 then change it to 1.0 and exit the method. If the tray's opacity is at 1.0 then we have already made that tray visible so check the next tray. If you have checked each tray and they are all visible (opacity == 1.0) then the user wins.
if tray1.opacity==0.2
tray1 set opacity to 1.0
else
if tray2.opacity==0.2
tray2 set opacity to 1.0
else
if tray3.opacity==0.2 ....

Hope this helps
Mark
   
Reply With Quote