PDA

View Full Version : play if the score<100 teminate otherwise...


stormshadow
07-21-06, 07:24 PM
if((_root.health>0) && (_root.score<100)){
//game
gotoAndStop(1);
}else if(_root.health<=0){
//losing message
gotoAndStop(2);
}else if(_root.score>=100){
//winning message
gotoAndStop(3);
}else{
//losing message
gotoAndStop(2);
}

i used that on a frame... it has its own layer... but what happens is when your playing the game (frame 1) and your health gets 0 or lower... nothing happens, but it is supposed to bring you to the losing message... (frame2)

there is the same problem with the score...

UnrealEd
07-29-06, 08:01 AM
try tracing _root.health and _root.score, probably the variable isn't passed correctly to the other frames.
tell us the result of the trace. if it is undefined you might wonna post the rest of the code.

Greetz,
UnrealEd