Black Holes ...

Discussion and feedback on Construct 2

Post » Sat Aug 25, 2012 2:27 am

Hello People ,
Long time I didn't ask a question !
I need to make a black hole physics for my game but i am stuck here
Let's say i have a planet in space and I control a black hole How can I make the planet turn around the black hole as in real life ( But without the spaguetti effect

Thank you very much !
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564

Post » Sat Aug 25, 2012 2:54 am

A tiled planet from actual size to one pixel.
A black hole reach radius.

Any planet that enters to the black hole radius would feel an atraction force to it, and the tile animation from planet would start.

(?)
B
29
S
6
G
5
Posts: 148
Reputation: 5,084

Post » Sat Aug 25, 2012 11:52 am

You can do it with the physics behavior. Turn off gravity with the action "set world gravity to 0" and use "apply force toward position". The position is the black hole and the force would be something like k*1/distance(object.x, object.y, blackhole.x, blackhole.y). "k" is basically how strong the black hole is. Change "k" it to whatever value you like, a higher value should give good results.

The objects will just move toward the center of the black hole unless you give the objects some velocity 90 degrees from the direction to the blackhole.
Here is a further discription with some useful diagrams:
http://www.physicsclassroom.com/class/circles/u6l4b.cfm

And here is where I got the gravity formula:
http://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219


Return to Construct 2 General

Who is online

Users browsing this forum: Mirlas, wrighthill and 16 guests