Skip to content

Instantly share code, notes, and snippets.

View oliverholmberg's full-sized avatar

Oliver Holmberg oliverholmberg

  • Red Foundry
  • Chicago
View GitHub Profile
@oliverholmberg
oliverholmberg / dabblet.css
Created March 7, 2016 14:59
Sticky Player Demo
/**
* Sticky Player Demo
*/
body {
background: #f06;
background: linear-gradient(45deg, grey, white);
min-height: 100%;
margin:0 5%;
}
@oliverholmberg
oliverholmberg / dabblet.css
Last active March 6, 2016 00:13
Sticky Player Demo
/**
* Sticky Player Demo
*/
body {
background: #f06;
background: linear-gradient(45deg, grey, white);
min-height: 100%;
margin:0 5%;
}
@oliverholmberg
oliverholmberg / orbital_gravity_2d.cs
Last active February 21, 2023 10:26
Orbital Gravity 2D - A demonstration of Orbital Gravity in a 2D Unity Game. Unity's standard physics engine implements gravity only in the vertical axis. Here's a demo of orbital gravity for space type games. It allows for one object (spaceship, satellite, etc.) to achieve a stable organic orbit around another object (planet, moon, star, etc.)
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
// Intended to be attached to a GameObject in order for that object to have its own gravity.
// Standard Unity Gravity is disabled on objects implementing this class
// This class is pared down from the original WorldBodyController used Oliver Holmberg's game Apogee to simply demonstrate orbital gravity.
public class OrbitalGravityObject : MonoBehaviour {