package alfredo.phx;

import alfredo.Component;
import alfredo.Entity;
import alfredo.Scene;
import alfredo.geom.Vector;
import java.util.ArrayList;

/**
 *
 * @author TheMonsterOfTheDeep
 */
public class Physics {
    public static Vector gravity = new Vector(0, 9.81f);
    
    public static void tick() {
        Entity[] entities = Entity.getAllEntities();
        
        ArrayList<Body> bodies = new ArrayList();
        
        for(Entity e : entities) {
            Body b = e.getComponent(Body.class);
            
            if(b != null) { bodies.add(b); }
        }
        
        for(Body b : bodies) {
            b.acceleration.set(gravity);
        }
        
        Scene.getCurrent().tick();
        
        for(Entity e : entities) {
            for (Component c : e.getComponents()) {
                c.tick();
            }
        }
    }
}

@@ -226,16 +226,22 @@
  static 
+final 
 Vector g
@@ -270,9 +270,10 @@
  9.8
-1
+07
 f);%0A

Update gravity value to be more accurate