# Trying to make a platform game with running animation

**URL:** <https://forum.kirupa.com/t/trying-to-make-a-platform-game-with-running-animation/212688>\
**Category:** Uncategorized\
**Created:** [January 13, 2007, 2:21am UTC](https://forum.kirupa.com/t/trying-to-make-a-platform-game-with-running-animation/212688 "2007-01-13T02:21:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jereminion](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@jereminion](https://forum.kirupa.com/u/jereminion)\
**Post date:** [January 13, 2007, 2:21am UTC](https://forum.kirupa.com/t/trying-to-make-a-platform-game-with-running-animation/212688/1 "2007-01-13T02:21:06Z")

</div>

hi im making a “complex” platform game. the default animation that is playing is the idle animation for when nothing is pressed.

the problem;

im trying to make it so when you press the RIGHT or LEFT key, the character plays the animation for running right. the problem im running into is

gotoAndPlay(18); … when i hold down the RIGHT key to go right… it keeps refreshing the command to go right so it keeps playing the first frame of the animation to run right

how can i get past this??

ive also tried

if ((!Key.isDown(Key.RIGHT) && (!Key.isDown(Key.LEFT))){  
gotoAndPlay(6);  
}

and this way the running animation is the default animation, and frame 6 is the idle animation for standing still

the reason this doesent work is because i have multiple ways to attack with CONTROL and SPACE. if i add a !key.isDown(KEY.SPACE)…ect then when i press space it just repeats the first frame of the attack… while at the same time solves my other problem of running

can someone post a way for me to do this ☹

or contact me via AIM  
jereminion

btw ill post theSWF  
[http://i5.photobucket.com/albums/y197/jereminion/smoothms.swf](http://i5.photobucket.com/albums/y197/jereminion/smoothms.swf)

controls:  
arrow keys to move, up to jump  
space to shoot  
CTRL to slice

i based this game off of Kirupa’s example so plz dont accuse me of stealing since i gave cred 😃  
 ![](http://i5.photobucket.com/albums/y197/jereminion/smoothms.swf)
