Help with Flash

Serpico

Farnese is the bomb diggity
Hey guys, I know some of you are pretty good with flash so I was wondering if anyone knew the answer to this. I started a Berserk game and I'm a little stuck on getting the basic movement to work properly. The walk cycle isn't playing when the character moves.

You can see a little demo of what I mean here. The controls are the arrow keys to move, and spacebar to attack.

www.ninetenths.org/serpy_game.html

Serpiko is a movie clip with the following code attached. Frame one is his idle stance. Frame 2 is his walk animation, and Frame 3 is his attack animation. For some reason the attack animation works and not the walk.

onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT)){
this._x -= 8;
_xscale=-100;
this.gotoAndStop(2);
} if(Key.isDown(Key.RIGHT)){
this._x += 8;
_xscale=100;
this.gotoAndStop(2);
} if(Key.isDown(Key.UP)){
this._y -= 8;
this.gotoAndPlay(2);
} if(Key.isDown(Key.DOWN)){
this._y += 8;
this.gotoAndStop(2);
}if(Key.isDown(Key.SPACE)){
this.gotoAndStop(3);
}else{
this.gotoAndStop(1);
}
}

Any help or ideas are appreciated.
 
I've had this problem before, it's about the character being refreshed and reloaded everytime you walk a bit.

I'll get the correct code for it when I'm home (or atleast, I'll try to.)

Might be handy to have the entire copy of it though. Maybe you could host a zip file containing your work somewhere?
 

Serpico

Farnese is the bomb diggity
chaoscontrol said:
I've had this problem before, it's about the character being refreshed and reloaded everytime you walk a bit.

I'll get the correct code for it when I'm home (or atleast, I'll try to.)

Might be handy to have the entire copy of it though. Maybe you could host a zip file containing your work somewhere?

Here is a copy of the flash file if thats what you wanted (350kb)
www.ninetenths.org/serpy_game.fla

If you are able to figure out the problem in the code that would be awesome. I think you are right about it being a matter of not refreshing properly. Only the final animation in the code will play. Before I added the attack animation, the walk cycle for the DOWN control was working.

Thanks for taking a look  :serpico:
I need to get this all sorted out before I bother start drawing or building anything further.

EDIT: I got the walk cycles to work by adding "else" before all the "if" statements, but now I lost to ability to move him diagonally.
 
Top Bottom