View Full Version : PLZ HELP - need help with health bar!!!
greenman
April 17th, 2005, 09:56 PM
Hey,
Im making a platform game in Flash MX, and i have just made a health bar, so that when my mc hits an enemy, he loses health. But , how do i script it so that when the health reaches 0, it goes to a gameover screen? can anyone help?
Any help would be great,
Greenman
Nox
April 17th, 2005, 10:13 PM
Depends on how you got the heathmeter set up.
If your healthmeter is a movie clip with each frame being a condition the character is in, then the last frame should be the game over frame. It's blank with just actionscript. And you should have the game over sceen on your main timeline.. here would be the code:
_root.gotoAndStop ( "gameOver" );
drosa10
April 17th, 2005, 10:19 PM
if(heath<=0){
gotoAndPlay("Game Over")
}
greenman
April 17th, 2005, 10:22 PM
Thanks!! Helped alot.
And also, when i mkae my mc jump, his head clips onto the platform above him. How do i get rid of that? and also, when my mc walks off the platform, he doesnt fall, he just keeps walking. How do i get rid of that?
Greenman.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.