Physics gravity direction

New releases and general discussions.

Post » Wed Sep 10, 2008 1:22 am

Would it be possible to add a Gravity Direction setting to the Physics behavior? I was tinkering around trying to make one of those roll-a-ball-around-a-maze things, where you rotate the entire screen. I'm sure there's some way to do it by adding force in a particular direction, but having a gravity direction thinger would make things easier, like:

+Always
- Physics: Set gravity direction to (System: Display angle) degrees

I'm sure there would be other uses too :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Sep 10, 2008 2:00 am

I don't know, doing it without a special option wouldn't be that hard. To make the gravity up, for example:

+Always
- Add force towards X: Sprite.X Y. Sprite.Y - 32 Force: 1000

Of course, an option would be preferable, but it's still not that hard.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Wed Sep 10, 2008 3:44 am

I thought about making the gravity go in the direction of a second sprite's image point, but then there was the problem of rotation. I messed around with it a bit more and came up with this:

http://www.fileshack.us/get_file.php?id ... g+maze.cap

I just make the gravity controller sprite always set to the opposite angle of the display. It actually works better than I thought it would. Thanks for the inspiration, linkman.

(By the way the new friction and elasticity settings are nice... good job guys :) )
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Sep 10, 2008 5:55 am

That's a really sweet example, right there. :) Never even thought of doing it that way.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Jan 27, 2009 9:41 am

It's an old topic, sorry for uping it, but i think it would be interested to define a global gravity for every item in a specific layer =)

A thing like that :
Actions for "System" -> Layers -> "Set global gravity angle"
And also a custom value on Layer properties, with default value equal to 90 (like Particles item)
B
7
G
3
Posts: 46
Reputation: 1,581


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests