1 package ru
.deadsoftware
.cavecraft
.game
;
3 import com
.badlogic
.gdx
.math
.RandomXS128
;
4 import com
.badlogic
.gdx
.utils
.Array
;
5 import com
.badlogic
.gdx
.utils
.TimeUtils
;
6 import ru
.deadsoftware
.cavecraft
.game
.mobs
.Human
;
7 import ru
.deadsoftware
.cavecraft
.game
.mobs
.Mob
;
8 import ru
.deadsoftware
.cavecraft
.game
.objects
.Player
;
10 public class GameProc
{
12 public static double RUN_TIME
= 0;
16 public Array
<Mob
> mobs
;
18 public GameWorld world
;
19 public GameRenderer renderer
;
20 public GamePhysics physics
;
22 public int cursorX
, cursorY
;
26 public boolean isTouchDown
= false;
27 public int touchDownX
, touchDownY
;
28 public long touchDownTime
;
31 world
= new GameWorld(4096,256);
32 renderer
= new GameRenderer(this);
33 physics
= new GamePhysics(this);
34 player
= new Player(world
.getWidth()/2*16+4, 0);
35 mobs
= new Array
<Mob
>();
39 public void resetRenderer() {
40 renderer
= new GameRenderer(this);
43 public void update(float delta
) {
46 physics
.update(delta
);
48 if (isTouchDown
&& TimeUtils
.timeSinceMillis(touchDownTime
) > 500) {
49 world
.placeToBackground(cursorX
,cursorY
,
50 player
.inventory
[invSlot
]);