{"author_name":"Julian Ceipek","cat":"LD #23","comments":[{"author_name":"dr_soda","time":"April 21, 2012 2:04 am","epoch":1334991840,"text":"One of my ideas this evening was about steering the planet earth around and crashing into asteroids, attempting to become bigger&#8230; ultimately realizing that it would never be as big as the giant stars.","spam":"N"}],"epoch":1334991540,"likes":1,"metadata":{"p_key":"58144","p_author":"Julian Ceipek","p_authorkey":"8564","p_urlkey":"93893","p_title":"Gravity Wells","p_cat":"LD #23","p_event":"LD23","p_time":"1334991540","p_likes":"1","p_comments":"1","p_status":"UPD5","us_key":"8564","us_name":"Julian Ceipek","us_username":"jceipek","event_start":"1334880000","event_key":"10","event_name":"LD23"},"text":"<p>Just finished Build 01. I added a big planet object that exerts mass on the player using Newton&#8217;s Law of Gravitation with an arbitrary G:<\/p>\n <p><img src=\"http:\/\/upload.wikimedia.org\/wikipedia\/en\/math\/0\/f\/3\/0f36df929ac9d711a8ba8c5658c3bfee.png\" alt=\"F = G \\frac{m_1 m_2}{r^2}\\ \" \/><\/p>\n <p><em>(Source: Wikipedia)<\/em><\/p>\n <p>I also implemented collisions with the planets: when you hit a planet, the large planet disappears.<\/p>\n <p>This gave me a lot of trouble, because I haven&#8217;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&#8217;t get the <a href=\"http:\/\/unity3d.com\/support\/documentation\/ScriptReference\/Collider.OnCollisionEnter.html\">OnCollisionEnter<\/a> 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 <a href=\"http:\/\/unity3d.com\/support\/documentation\/ScriptReference\/CharacterController.OnControllerColliderHit.html?from=ControllerColliderHit\">OnControllerColliderHit<\/a>\u00a0function.<\/p>\n <p>You can try out my latest build here:\u00a0<a href=\"http:\/\/jceipek.github.com\/LudumDare23\/\">http:\/\/jceipek.github.com\/LudumDare23\/<\/a><\/p>\n <p><a href=\"http:\/\/www.ludumdare.com\/compo\/2012\/04\/21\/gravity-wells\/build01\/\" rel=\"attachment wp-att-121914\"><img class=\"alignnone size-large wp-image-121914\" src=\"http:\/\/www.ludumdare.com\/compo\/wp-content\/uploads\/2012\/04\/Build01-550x317.png\" alt=\"\" width=\"550\" height=\"317\" srcset=\"http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/04\/Build01-550x317.png 550w, http:\/\/ludumdare.com\/compo\/wp-content\/uploads\/2012\/04\/Build01.png 923w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><\/p>\n <p>&nbsp;<\/p>\n <p>I think it&#8217;s time to go to sleep for a bit.<\/p>\n <p>&nbsp;<\/p>\n <p>Livestream:\u00a0<a href=\"www.twitch.tv\/jceipek\">www.twitch.tv\/jceipek<\/a><\/p>\n <p>Screencast:\u00a0<a href=\"http:\/\/students.olin.edu\/2012\/czwiebel\/webcam\/\">http:\/\/students.olin.edu\/2012\/czwiebel\/webcam\/<\/a><\/p>\n <p>&nbsp;<\/p>","time":"April 21st, 2012 1:59 am","title":"Gravity Wells"}