fd6d0fe748622debb40ff4f5db865388c57f36f8
1 package ru
.deadsoftware
.cavecraft
.game
;
3 import com
.badlogic
.gdx
.utils
.Array
;
4 import com
.badlogic
.gdx
.utils
.TimeUtils
;
5 import ru
.deadsoftware
.cavecraft
.game
.mobs
.Human
;
6 import ru
.deadsoftware
.cavecraft
.game
.mobs
.Mob
;
7 import ru
.deadsoftware
.cavecraft
.game
.objects
.Player
;
9 public class GameProc
{
11 public static double RUN_TIME
= 0;
15 public Array
<Mob
> mobs
;
17 public GameWorld world
;
18 public GameRenderer renderer
;
19 public GamePhysics physics
;
21 public int cursorX
, cursorY
;
25 public boolean isTouchDown
= false;
26 public int touchDownX
, touchDownY
;
27 public long touchDownTime
;
30 world
= new GameWorld(512,256);
31 renderer
= new GameRenderer(this);
32 physics
= new GamePhysics(this);
33 player
= new Player();
34 mobs
= new Array
<Mob
>();
38 public void resetRenderer() {
39 renderer
= new GameRenderer(this);
42 public void update(float delta
) {
45 physics
.update(delta
);
47 if (isTouchDown
&& TimeUtils
.timeSinceMillis(touchDownTime
) > 500) {
48 world
.placeToBackground(cursorX
,cursorY
,
49 player
.inventory
[invSlot
]);