Flick Platformer Help

adalpilscazaadalpilscaza Member Posts: 44
edited February 2012 in Working with GS (Mac)
I am trying to make a plaformer game where, in order to move, the player flicks in a direction on the screen. The player can only jump twice , and when the player hits a wall, its jump count resets (the player has double jumping). I have the flicking and the double jump down. The issue I have is when the player flicks his screen while in the air and after already using both jumps, upon landing the player accelerates in the direction of the flick. I'm not sure if you can understand what I'm saying, but if you want to check out my file and try to come up with a solution, the download link is below:
http://www.mediafire.com/?0yb6bfay16puczy

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited February 2012
    You need to lock out the flick when the character isn't in contact with the ground and both jumps are gone.
  • adalpilscazaadalpilscaza Member Posts: 44
    edited February 2012
    @FryingBaconStudios

    In my player actor, I have:
    When mouse button is down AND jumpCount <= 1 (for some reason, jumpCount <= 2 allows the player to jump three times, while <= 1 works for double jump)
    Change touchX to mouse position X
    Change touchY to mouse position Y

    When mouse button is up AND jumpCount <=1
    Change releaseX to mouse position X
    Change releaseY to mouse position Y
    Change self.linearVelocity.X to 2* (releaseX-touchX)
    Change self.linearVelocity.Y to 2* (releaseY-touchY)


    Am I doing something wrong
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited February 2012
    That's because you're starting at zero on your jump count so it should =0 and then <= 1. Which would be throwing off your other stuff too. See what I'm saying so the attribute is zero and the player jumps then it changes to one and the player jumps and it changes to two. So you get three jumps, which is you have that extra movement at the end as you're rule locking it out is still active because your count is off.
Sign In or Register to comment.