A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: problem with moving

  1. #1
    Member
    Join Date
    Sep 2004
    Location
    Qc
    Posts
    53

    problem with moving

    im makin a minigame (before i start my real project, just to get the hang of it...) but, when my guy lands (especaly after a jump) he gets stuck in the ground ant it takes a few jumps before he is free enough to move. can you help me stop this?

    i also want to make it so if the spacebar is held down (to always jump when you hit the ground) i do not want it to go to "stand" because it flashes by and looks ugly. can anyone fix this?
    Attached Files Attached Files

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Try this to fix jumping:
    code:
    function jump_down(valueY) {
    if (!this.stagemc.limitmc.hittest(this.Worm._x, this.Worm._y, true)) {
    this.Worm._y += valuey;
    } else {
    // if you fall too deep in a limit, then you are placed correctly
    for (i=1; i<=100; ) {
    if (!this.stagemc.limitmc.hittest(this.Worm._x, this.Worm._y, true)) {
    break;
    }else{
    this.Worm._y -= 1;
    }
    }
    this.Worm.gotoAndStop("stand");
    }
    }


    Dunno about the SPACE key being hold, I dont understand where the function is called from.

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