PDA

View Full Version : Help On Making A Game Over!


VictorTheGamer
06-03-2008, 07:39 PM
Hello Everyone!

This is Victor again!

Im having a question........

I made a Jetpack game, and i want that When the jet pack touch the ground, YOU LOSE! how do i do it? is there any code you guys can show me?

For now, if the jetpack touch the ground, it stand on hte ground, but i want to make it when it touch the ground, it will be GameOver

zilchvortex
06-03-2008, 10:05 PM
Hey victor
you could use a hit test if the floor is a box use a box collision like this

if(Jetpack.hitTest(Floor)){
gotoAndStop(2);}

which is a box collision type which eman when it hits the bounding box of the object e.g square it will go and stop frame 2 which will have your you lose!! on it or if it is bumpy do a graphic hit test which is

if(Floor.hitTest(Jetpack._x,Jetpack._y,true)){
gotoAndStop(2);}

which means that it will do the same as last time but it checks for collision on the graphic not the bounding box.

MasalaFingers
07-17-2008, 02:01 PM
:confused: I am making a similar game, but when my 'jetpack' hits the 'floor' it just goes straight past it, it doesn't even stop. I am very new to actionscript and i really need some help
Thanks a lot

MasalaFingers
07-18-2008, 04:00 AM
hey everyone,
sorry 'bout that, it's working fine now, there was a problem in my earlier code