Physics+Platformer

Get help using Construct 2

Post » Tue Oct 09, 2012 10:09 pm

Hello :)
So, there's a platform movement, walks along solid floor and up slopes and whatnot, and I decide I want to add physics. I give the physics behaviour to the player and the floor, and I make some box sprites to test collision. Now, the player vibrates when he's landed, and the box sprites behave nicely, and the pushing collision isn't so bad when the player touches the boxes, but then I wonder,
How would I perfect the collision with the box+player?
How would I prevent the player from vibrating up and down on the ground?
How would I allow the player to be able to stand on the box? (Setting a Solid behaviour stops the player from being able to push the boxes)
Thanks very much
B
45
S
19
G
10
Posts: 562
Reputation: 9,543

Post » Wed Oct 10, 2012 12:49 am

Physics behavior is not compatible with the platformer behavior. Your best bet is to synthesize a platform movement using physics. it's fairly easy to do.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Oct 10, 2012 1:07 am

One of the way to control player in box2d is to make kinematic body. But i didnt find this in construct 2.
B
2
Posts: 3
Reputation: 256

Post » Wed Oct 10, 2012 1:11 am

Not sure what a 'kinematic body' is, but making a physics based platformer is trivial. Just apply forces for side movement, and an upwards impulse for jump.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Oct 10, 2012 1:26 am

"A kinematic body is an hybrid body which is not affected by forces and collisions like a static body but can moved with a linear velocity like a dynamic body." And by dynamic bodies you don't have control over mass in cons2. Why this physic restrictions by cons2? Box2D is very powerfull and cons2 use this engine.Sam555552012-10-10 01:31:14
B
2
Posts: 3
Reputation: 256

Post » Wed Oct 10, 2012 1:50 am

@sam55555, I think Scirra were focused on implementing the most important features. They can't do everything ;)

Also, I'm pretty sure you can control density, which is just mass with area factored out.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Oct 10, 2012 2:16 am

@squiddster is right , it's fairly easy to make a platformer with physics plugin !
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Wed Oct 10, 2012 2:32 am

Hmm, I did try making a physics platformer using Construct Classic a very long time ago, but the main problem I ran into was traveling down slopes. How would I keep the player firmly on a slope as it travels down it as a physics object? The platform behaviour in Construct 2 handles slopes perfectly :PJase002012-10-10 02:33:21
B
45
S
19
G
10
Posts: 562
Reputation: 9,543


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Axiomaltd, MACPK, nicklowkcmagic, OddConfection, radbrothers and 23 guests