Help with moving and jumping

AkonronAkonron Member Posts: 11
edited November -1 in Working with GS (Mac)
Hello everyone

I am currently creating a game, but I need one of the actors to be able to jump.
I have managed to find out how to make the actor preform the jump, but if i want it to move left or right at the same time,
the actor stops in the middle of the air and starts moving to either side. as soon as i let go of the move-button,
it starts to fall again.

Does anyone know how to fix this problem?

Comments

  • Mr.pHMr.pH Member Posts: 26
    Well there are two things that you need to modify.....

    the first is that you need to add gravity to the scene. It is under the Scene Tab where you edit screen size and camera stuff(not sure how else to describe it.)

    The other is that you need to add density to the actor. That is under the physics option.

    Hope that helps
  • AkonronAkonron Member Posts: 11
    I have already created the jump instance, but if i try to move the
    actor left or right while jumping, the actor will stop falling until i stop moving left or right.
  • Mr.pHMr.pH Member Posts: 26
    Yeah.....I am doing something similar in my project and all that happens is that it slowly falls.....I think it is because it is staying suspended because it is being pushed left or right and not falling......but i am still trying to figure out how to fix this...
  • AkonronAkonron Member Posts: 11
    I figured that out, but i am having trouble fixing it too.

    Would be happy if you would tell if you come up with a solution.
  • KamazarKamazar Member Posts: 287
    *sigh* Before you ask any more questions, check out the sample project labeled "Platformer" when you open the app. Go to the main character's actor and the scene editor. Put it all together, and experiment. That way, you'll learn instead of carrying out an action you don't understand.
  • AkonronAkonron Member Posts: 11
    I am sorry i did not check the templates, thanks for the advise.
    But after I completed the jump, i now got a new problem, now the actor will keep on moving
    because of the acceleration-command. How can i stop him?
  • KamazarKamazar Member Posts: 287
    Set up a timer.

    If spacebar key is down
    Accelerate at 600 in direction 90 (move upwards)
    After 5 seconds
    Change velocity to 0 (keeps you from moving upwards. gravity will then take over)
  • quantumsheepquantumsheep Member Posts: 8,188
    That's a good solution Kamazar. I've personally set it up so that after a certain time (5 seconds in your case) I accelerate in a downwards direction at the same speed I went up ;)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.