DEADSOFTWARE

Add player and physics
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / GameProc.java
index bd91e725ef85509829cd2fcf9eab7f30ae054b0c..61c64ffebf940ab81233bce72fb7da74977c4e2a 100644 (file)
@@ -1,13 +1,17 @@
 package ru.deadsoftware.cavecraft.game;
 
 import com.badlogic.gdx.utils.TimeUtils;
+import ru.deadsoftware.cavecraft.game.objects.Player;
 
 public class GameProc {
 
     public static double RUN_TIME = 0;
 
+    public Player player;
+
     public GameWorld world;
     public GameRenderer renderer;
+    public GamePhysics physics;
 
     public int cursorX, cursorY;
 
@@ -16,12 +20,21 @@ public class GameProc {
     public long touchDownTime;
 
     public GameProc() {
-        world = new GameWorld(512,16);
+        world = new GameWorld(512,32);
+        renderer = new GameRenderer(this);
+        physics = new GamePhysics(this);
+        player = new Player();
+    }
+
+    public void resetRenderer() {
         renderer = new GameRenderer(this);
     }
 
     public void update(float delta) {
         RUN_TIME += delta;
+
+        physics.update(delta);
+
         if (isTouchDown && TimeUtils.timeSinceMillis(touchDownTime) > 500) {
             world.placeToBackground(cursorX,cursorY,1);
             isTouchDown = false;