PDA

View Full Version : hittest


Pedal-kid
07-03-2008, 10:03 PM
I need help!! I am making a stickman game, and I got trouble with the hittest allready.. When the stickman hits the ground, flash is supposed to gotoAndStop frame 3 inside the Stickman MC.. But I when flash has played the "clip" inside frame 3 in the Stickman MC, I wont flash to go to another frame frame, and stop repeating the clip inside frame 3 in Stickman MC
plz download and help me
here is the download link:)
http://www.zshare.net/download/146491303ee1db5a/

And if you need the actionscript code;Here it is:
onEnterFrame=function() {
gravity=9;
dude._y+=gravity;
xspeed=4;
if (dude.hitTest(ground)) {
gravity=false;
if (gravity==false) {
dude.gotoAndStop(4);
dude._y=ground._y-17;
if (Key.isDown(Key.LEFT)) {
dude._x-=xspeed;
dude.gotoAndStop(3);}
if (Key.isDown(Key.RIGHT)) {
dude._x+=xspeed;
dude.gotoAndStop(2);
}

}




}
}

peter5
07-04-2008, 04:06 AM
I am not trying to be anal, I do want to help, however I cannot understand what you are trying to say.

Take the time to re-read your question. You will get responses if you take the time to word your question well.

Pedal-kid
07-04-2008, 07:06 PM
I am not trying to be anal, I do want to help, however I cannot understand what you are trying to say.

Take the time to re-read your question. You will get responses if you take the time to word your question well.
sorry, my english sucks... But I'll try to explain a little better this time..
ok.. When you have downloaded the file and pressed ctrl+Enter, you will se the stickman falling down, and when the he hits the ground, he bends over, and stands up again.. When you move him to the left and right with the arrows, you see that whenever you release the arrow key, he bends over and stands up again, what shall I do to make him stop doing that movement every time I release the arrow key? dont forget to download :P