ForumsProgramming ForumAnimating a Run in AS2 ?

2 3263
markzi
offline
markzi
103 posts
Nomad

I am making another Platformer, since Armor Games didn't put my old game up, i figured it was because it wasn't that good, so I want to make a better one, I am using AS2 and I just want an idea of how to animate a walk or run. Thanks.

  • 2 Replies
mixinghoney
offline
mixinghoney
6 posts
Nomad

Ok, first of all you have to have a character . Convert him to a symbol , then double click him , make 2 frames , the first one call : Run or Walk , double click it , now animate . For the second one call it jump, then animate it. When you're done , Back to main page , then right click your character -> Actions , then type it in:

onClipEvent (load) { moveSpeed = 10;}onClipEvent (enterFrame) { if (Key.isDown(Key.RIGHT)) { this._x += moveSpeed; } else if (Key.isDown(Key.UP)) { this._y -= 0; } else if (Key.isDown(Key.DOWN) && !fall) { this._y += 0; } else if (Key.isDown(Key.LEFT)) { this._x -= moveSpeed; }}onClipEvent (enterFrame) { if (Key.isDown(Key.SPACE) && !jumping) { vel_y = 36; jumping = true; } if (jumping == true) { vel_y -= 2; if (vel_y<=-15) { vel_y = -15; } this._y -= vel_y; } if (_root.ground.hitTest(this._x, this._y+35, true)) { vel_y = 0; jumping = false; }}onClipEvent (enterFrame) { this._y += 16; if (_root.ground.hitTest(this._x, this._y+1, true)) { this._y -= 16; }}












I hope i helped!!

markzi
offline
markzi
103 posts
Nomad

Thanks a lot! I really appreciate it!!

Showing 1-2 of 2