Tuesday, July 28, 2009

Here we go: running and platforms and jumping

Basically the movement is similar to what we learned earlier with overhead movement jumping is easiest to explain by showing you this
if (Key.isDown(Key.UP) && !jumping) {
jumping = true;
}
if (jumping) {
this.gotoAndStop("jump");
this._y -= jump;
jump -= .5;
if (jump<0) {
falling = true;
}
if (jump<-15) {
jump = -15;
}
}






Plat forms are simply hit tests that tell it not to fall anymore and then the hero is always falling if its not jumping or on platform the code is constantly checking to make sure if it is

No comments:

Post a Comment