I got this code from KoolExchange and I need som help. The ball jumps but i can't make it land on the platform above it.
http://www.freewebs.com/stealth_guild/jumptest.swf
Here is the code for the ball:
Quote:
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x += 5;
} else if (Key.isDown(Key.LEFT)) {
this._x -= 5;
}
if (Key.isDown(Key.UP)) {
JUMPing = true;
}
if (JUMPing) {
this._y -= JUMP;
JUMP -= .5;
if (JUMP<5) {
if (JUMP<-10) {
JUMP = -10;
}
}
if (_root.platform.hitTest(this._x, this._y, true)) {
JUMP = 12;
JUMPing = false
if (_root.platform.hitTest(this._x, this._y, true)) {
JUMP = 12;
JUMPing = false
}
}
}
}
