PDA

View Full Version : Simple fighting game



Mr.Pancake
July 2nd, 2007, 02:58 PM
So I want to make a little fighting game, im strumbling over the animation.

I have a movieclip of the hero, wich contains movieclips of:
-idle
-hit
-walk

this is the code:


onClipEvent(load){
if(Key.isDown(Key.RIGHT))
this.gotoAndStop("walk")
if(keyUp(Key.RIGHT));
this.gotoAndStop("idle")
}

the idle animation is good when i try it.
but whenever i press right nothing happens.
Can anyone tell me what i'm doing wrong?

Mr.Pancake
July 2nd, 2007, 03:44 PM
Never mind, After doodling alot, i found out that this code works:


onClipEvent(enterFrame){
if(Key.isDown(Key.RIGHT))
this.gotoAndPlay("walk")
else
this.gotoAndPlay("idle")
}