Jumping and Walking help

zNiiCzNiiC Member Posts: 74
edited April 2012 in Working with GS (Mac)
So I am using the platformer template, and I was wondering how I can only have my player jump every 5 or so seconds. I created an integer of 5, and when the player jumps, I subtract 5. Every second, 1 is added to the integer, although this doesn't work. Need some help here. Also, when the user holds down the left or right button, the player slowly goes faster and faster. How can I get the player to travel at a set speed?

Best Answer

  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    edited April 2012 Accepted Answer
    Here ya go.

    You cant move left or right when you jump, and when you jump you have to wait another 5 seconds to jump again. Also travels at a set speed. Using accelerate wont do that because thats the point of accelerate. Think of pressing the gas pedal in a car, thats what accelerate does.
    http://www.mediafire.com/?oooko933w3bu0lg

Answers

  • zNiiCzNiiC Member Posts: 74
    edited April 2012
    So I am using the platformer template, and I was wondering how I can only have my player jump every 5 or so seconds. I created an integer of 5, and when the player jumps, I subtract 5. Every second, 1 is added to the integer, although this doesn't work. Need some help here. Also, when the user holds down the left or right button, the player slowly goes faster and faster. How can I get the player to travel at a set speed?
  • NmdogdudeNmdogdude Member Posts: 174
    Make a rule 'when touch is pressed' timer behavior " every 5 seconds, accelerate actor 'player' up (270 degrees)" and create another behavior for 'player' actor to accelerate 90 degrees at a set speed.
    Hope this helps :D
  • zNiiCzNiiC Member Posts: 74
    edited April 2012
    im already using the accelerate behavior. Direction is 0 (right) and acceleration is 850. Can I at least disable moving while the player is jumping?
  • calvin9403calvin9403 Member Posts: 3,186
    So you want the player to stay in the same place while jumping? That is weird because in physics the actor will keep going
  • zNiiCzNiiC Member Posts: 74
    edited April 2012
    I don't want the move buttons to be active when the player jumps. I will upload a video shortly explaining why I don't want the player to be able to jump constantly.

    Video:
  • zNiiCzNiiC Member Posts: 74
    Perfect! But just one question, is there a reason why the character slows down to a complete stop when I extend the scene size and hold down the move button?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    edited April 2012
    Not sure, doesnt happen to me. Youll have to put the move buttons on a non scrollable layer though if you make the scene bigger. Also did you add some other objects across the larger scene to check? It could just appear its not moving.
  • zNiiCzNiiC Member Posts: 74
    Yea i but the buttons on a non scrollable layer. My background is binder paper, so im pretty sure it slows down.

Sign In or Register to comment.