DEADSOFTWARE

Add input handling
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / GameProc.java
1 package ru.deadsoftware.cavecraft.game;
3 import com.badlogic.gdx.utils.TimeUtils;
5 public class GameProc {
7 public static double RUN_TIME = 0;
9 public GameWorld world;
10 public GameRenderer renderer;
12 public int cursorX, cursorY;
14 public boolean isTouchDown = false;
15 public int touchDownX, touchDownY;
16 public long touchDownTime;
18 public GameProc() {
19 world = new GameWorld(512,16);
20 renderer = new GameRenderer(this);
21 }
23 public void update(float delta) {
24 RUN_TIME += delta;
25 if (isTouchDown && TimeUtils.timeSinceMillis(touchDownTime) > 500) {
26 world.placeToBackground(cursorX,cursorY,1);
27 isTouchDown = false;
28 }
29 }
31 }