How do I make jump movement?

0 favourites
  • 4 posts
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • Hello, I have a ball object that needs to be jumping on mouse click anywhere on the screen and fall down if not clicked back within 2 sec. Unable to find how to implement that behavior. Please suggest.

  • I would start with giving the ball object the physics behavior and then using apply force action in the up direction. If you want it to jump toward the cursor click then you can grab the mouse.x, mouse.y in variables and then set angle to these when you apply the force. With the physics behavior attached the ball object will automatically fall with "gravity" so you would simply need to tweak the dampening until you achieved the appropriate 2 second effect your after.

    You will need to have added the mouse or touch objects to the project by double clicking layout and selecting it from tools object menu that pops up.

    The mouse event you will probably need is the On-click (not On-clicked!) and use left mouse with single or double-click whichever fits your game.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • you mean jumping towards the mouse? or just jumping as a platformer on vertical axes? if its like a platformer then you need to add the platformer behavior and on mouse click simulate control jump . and that should do it... if you want to jump towards mouse... then you need to simulate other controls but then its easier using as said using the physics behavior and applying a impulse of 5-10 towards the touch/mouse x y the fall is a matter of adjusting the physics behavior how hard or soft should fall etc.

    you also have to remember... platformer behavior only interacts with solid objects (add solid behaviors to walls... and platformer to your main character)

    physics objects only interacts with other objects that have physics behavior. dont combine platformer with physics you will get weird stuff...

  • I would start with giving the ball object the physics behavior and then using apply force action in the up direction. If you want it to jump toward the cursor click then you can grab the mouse.x, mouse.y in variables and then set angle to these when you apply the force. With the physics behavior attached the ball object will automatically fall with "gravity" so you would simply need to tweak the dampening until you achieved the appropriate 2 second effect your after.

    You will need to have added the mouse or touch objects to the project by double clicking layout and selecting it from tools object menu that pops up.

    The mouse event you will probably need is the On-click (not On-clicked!) and use left mouse with single or double-click whichever fits your game.

    Thanks! Your idea worked perfect!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)