How do I make jump movement?

Get help using Construct 2

Post » Wed May 04, 2016 9:10 am

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'm not the best, but i like making games in Construct
B
23
S
7
G
1
Posts: 35
Reputation: 2,217

Post » Wed May 04, 2016 1:54 pm

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.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
68
S
17
G
8
Posts: 637
Reputation: 9,420

Post » Wed May 04, 2016 3:58 pm

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 @Chrisinfinger 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...
B
77
S
23
G
69
Posts: 1,353
Reputation: 43,960

Post » Fri May 06, 2016 6:38 am

chrisinfinger wrote: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! :D
I'm not the best, but i like making games in Construct
B
23
S
7
G
1
Posts: 35
Reputation: 2,217


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Yahoo [Bot] and 42 guests