Score problems

immaking a game, and when the health reachs zero i want it to go to a game over scean. ive looked it up and tryed what people said but it still didnt work. please,a little help

Put a frame far away in your timeline, label it “gameover” and then test the value of your score (in a controller clip for instance).

pom 0]

im sorry, i havent used flash in awhile so i dont exactly know what that all ment . so can you explain that to me a little better

Well, I don’t know, it depends. Try to put an empty movie clip in your movie, that is always present, and always checks whether score=0, and if so does _root.gotoAndPlay (“gameover”) ;

Send me your fla so that I give your an example if you don’t understand.

pom 0]

it just goes stright to the gameover frame???

What I would do to keep the game timeline clean it put the game over sequence in a seperate Scene. In the menu goto Windows/Panels/Scene and then click on the plus button to make a new Scene and call it gameover.

Make your game over sequence there, and when you need to call it up in the game Scene, make sure in the gotoAndPlay command you have it directed at the gameover scene. (there will be a dropdown menu so you can select that scene.

ok, i know this may sound annoying but could someone just give me a test fla.and then ill just figure out the scriptmyself. cause imstill not totaly undersatnding what everyone is saying.soto save the trouble of me and you guys tokeep on posting here trying to help me understand.usualy we i have the script in front of my working i can usualy undersatnd it and figure out how it works and what i did wrong

I think I can explain a good method for this.

Take a white square of fill, 50 pixels high, and 10 pixels wide.

Select it and make it a movie clip by hiting F8.

Select the movie clip on the main stage with the black arrow tool. Open your “Action” panel.

click in the white area of the action panel and paste the following code.


the “_root.playerHealth” being, whatever variable you’re using to keep track of the players health.

the “endGame” being the label placed in the frame that begins your end of game sequence of frames.

in this case you can take this bar and place it anywhere you like, either off stage, or behind a slightly transparent bar of gradient. It could then be used as an on screen visual to show the players life total in an easy to read format.