A Flash Developer Resource Site

Results 1 to 17 of 17

Thread: Jumping Platforms

Threaded View

  1. #1
    Member
    Join Date
    Jan 2006
    Posts
    44

    Jumping Platforms

    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:

    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
    }
    }
    }
    }
    Last edited by bailyesboy; 11-01-2006 at 09:42 AM. Reason: Link

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center