Platformer with physics, object interacting

For questions about using Classic.

Post » Mon Oct 31, 2011 1:06 pm

Hello,

im posting again.
I want to create game like LIMBO. I think guys, you know it.
So far, Ive got physics on crates etc., wich are pushable and pullable.
But I dont know how to make my character move, jump with physics behavior on it. If I have only platformer movement, it dont act like it have physics. If i have physics only, i dont know how to script movement and things like that.

So guys, what is the solution for my problems?
Here, I have found what i exactly need:
http://www.youtube.com/watch?v=LuFDA5h6CLo&feature=channel_video_title

Its done in Construct Classic, so it is possible. Can you help me? Thanks.
B
2
G
2
Posts: 35
Reputation: 720

Post » Tue Nov 01, 2011 9:06 am

I would suggest to use a rectangular sprite which serves as the player hitbox and has the physics behavior attached. Enable "Gravity" and "No rotation", also you probably want the "Contact elasticity" to be 0%.

Now make events that add force (Physics tab). For moving left/right add negative/positive values to the X component. Don't forget Timedelta, because this is repeated when the key is held down. Also you need to include a condition that prevents force to be added when you're already at your maximum movement speed.

For jumping add force again, this time a negative value to the Y component. Also this is usually a one time key press, no Timedelta here.

Well, those are the very basics that should get you going I hope. Mixing Physics and Platform behavior won't work too well, as you probably have figured out yourself. Remember to keep centered hotspots for all physics objects and also use bounding box collision masks where possible for maximum performance.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Nov 01, 2011 9:12 am

Another thing you can try, but then you have to manually make your character slow down when pushing heavy things for instance because physics wont do it for you anymore -
Is have both physics and platform behavior on your character and have physics property immovable enabled. as of cc-r1, an immovable physics object will apply forces that correspond roughly to any object movement made outside physics behavior.

If you need physics to be able to knock around your character momentarily, you disable platform, and change to moveable and then back again when you're done
lucid2011-11-01 09:15:01
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Tue Nov 01, 2011 9:44 am

Very, very thanks guys. Im gonna try your solutions.
Can you explain me what is Timedelta and give me some examples?
B
2
G
2
Posts: 35
Reputation: 720

Post » Wed Nov 02, 2011 4:32 pm

Bump
B
2
G
2
Posts: 35
Reputation: 720

Post » Wed Nov 02, 2011 4:38 pm

http://dl.dropbox.com/u/36415207/Physics%20platformer.rar
B
18
S
4
G
1
Posts: 413
Reputation: 2,512

Post » Wed Nov 02, 2011 5:01 pm

New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Wed Nov 02, 2011 5:37 pm

"Construct's behaviors are all already programmed to work in units of pixels per second. This means they're all guaranteed to move at the same rate on any computer, no matter the framerate. It is only when you move objects via events that you can get in to tick-based problems. "

Well, from my experience the 8 direction movement does not.
B
18
S
4
G
1
Posts: 413
Reputation: 2,512


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest