/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> void Awake() { // PHYSICS INIT! mWorld = new JelloPhysics.World(); // static ground object. GameObject ground = new GameObject (); JelloPhysics.ClosedShape groundShape = new JelloPhysics.ClosedShape (); groundShape.begin(); groundShape.addVertex(new Vector2(-10f, -2f)); groundShape.addVertex(new Vector2(-10f, 2f)); groundShape.addVertex(new Vector2(10f, 2f)); groundShape.addVertex(new Vector2(10f, -2f)); groundShape.finish(); // make the body. JelloPhysics.Body groundBody = new JelloPhysics.Body(); groundBody.Setup(mWorld, groundShape, float.PositiveInfinity, new Vector2(0f, -5f), 0f, Vector2.one, false); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> void Awake() { // PHYSICS INIT! mWorld = new JelloPhysics.World(); // static ground object. GameObject ground = new GameObject(); JelloPhysics.ClosedShape groundShape = new JelloPhysics.ClosedShape(); groundShape.begin(); groundShape.addVertex(new Vector2(-10f, -2f)); groundShape.addVertex(new Vector2(-10f, 2f)); groundShape.addVertex(new Vector2(10f, 2f)); groundShape.addVertex(new Vector2(10f, -2f)); groundShape.finish(); // make the body. JelloPhysics.Body groundBody = new JelloPhysics.Body(); groundBody.Setup(mWorld, groundShape, float.PositiveInfinity, new Vector2(0f, -5f), 0f, Vector2.one, false); }