Physics - platform character

For questions about using Classic.

Post » Mon Jun 01, 2009 9:11 pm

I'm trying to make a physics-focused platformer where the player-character is able to interact with the physics objects. Problem is, the platformer-behavior character doesn't interact with the physics-based objects. Is there any way around this, or is it possible to give a physics-based object a platform-style movement? (I've tried this by adding force, but the player object stops and freezes in place at random moments for no good reason)
B
2
G
3
Posts: 22
Reputation: 894

Post » Mon Jun 01, 2009 9:39 pm

Yes, it is possible to make a platforming game engine just using physics. See here: viewtopic.php?f=4&t=2961

It takes some work, though. And there are a lot of little things you need to do to tweak it just right.

What sort of interactions do you need? Perhaps you can fake it with another means. If it's just something like you need the player to thrown a physics-y ball, then that's easy. But if you need lots of movable stuff that pushes the player around then yeah, you'll probably need to ditch Platform and use Physics. Just keep plugging away at it.

And if you're having trouble with one particular bit, go ahead and post your .cap so someone can take a look. Vague descriptions like "I've tried this by adding force, but it freezes" don't help much.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Jun 02, 2009 3:54 am

I've managed to get the player character to move left and right, but I'm running into problems with getting it to jump. Is there any way to make a physics object "bounce" upward by, say, adding force in a certain direction? Hope this is a little clearer.
Thanks!
B
2
G
3
Posts: 22
Reputation: 894

Post » Tue Jun 02, 2009 4:11 am

One more question: would it be possible to give a platform object a property that allows it to interact with physics objects? I'm not trying to do anything crazy, just enable the player to move boxes out of the way, for example
B
2
G
3
Posts: 22
Reputation: 894

Post » Tue Jun 02, 2009 5:40 am

to jump add action, under the physics tab

set velocity to -1000

or

add force -100000

those numbers are probably too weak or too strong, and also depend upon your physics settings
but either one will make an object jump. You can tweak it afterward, but it's a start
[quote:22weebpp]
One more question: would it be possible to give a platform object a property that allows it to interact with physics objects? I'm not trying to do anything crazy, just enable the player to move boxes out of the way, for example[/quote:22weebpp]
no. unfortunately physics does not work well with other behaviors. You can create an almost perfect replica of platform with physics and events though. And even add your own features
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Jun 03, 2009 12:06 am

I have mixed other behaviors with physics by doing the following:

A: platform behavior, physics with Inmovable set
B: solid attribute set, physics with inmovable set
C: solid attribute set, physics with gravity
D: physics with gravity

C and D fall and bounce off B as expected
A can stand and jump off B as expected
However...
A may stand and jump off C but C doesn't react to it
A doesn't react to D, however D is pushed as if A had infinite mass.

O_o
I've used a physics proxy before, but that didn't go so well. You could try it. Or go the all-physics route. They're both hard.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Jun 03, 2009 1:49 pm

Yeah I think you can attach an immovable physics object to a platform object, as a "detector"... Just have to make the immovable physics object always follow the platform object.

I do believe, though, that this still causes weird glitches and stuff... it's been a long time since I played around with the idea, but I'm fairly certain it works to some degree.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests