Gravity Wells

Just finished Build 01. I added a big planet object that exerts mass on the player using Newton’s Law of Gravitation with an arbitrary G:

F = G \frac{m_1 m_2}{r^2}\

(Source: Wikipedia)

I also implemented collisions with the planets: when you hit a planet, the large planet disappears.

This gave me a lot of trouble, because I haven’t tried to detect collisions in Unity before (not counting cases where a trigger object detects if another object enters it). For example, I couldn’t get the OnCollisionEnter function to register any collisions at all, regardless of whether I attempted to perform collisions between rigid bodies or sphere colliders. Eventually, I just told the player script to send messages to any objects that it hit via the OnControllerColliderHit function.

You can try out my latest build here: http://jceipek.github.com/LudumDare23/

 

I think it’s time to go to sleep for a bit.

 

Livestream: www.twitch.tv/jceipek

Screencast: http://students.olin.edu/2012/czwiebel/webcam/

 

Comments

dr_soda
21. Apr 2012 · 07:04 UTC
One of my ideas this evening was about steering the planet earth around and crashing into asteroids, attempting to become bigger… ultimately realizing that it would never be as big as the giant stars.