1 package ru
.deadsoftware
.cavecraft
.game
.mobs
;
3 import com
.badlogic
.gdx
.math
.RandomXS128
;
4 import com
.badlogic
.gdx
.math
.Rectangle
;
5 import com
.badlogic
.gdx
.math
.Vector2
;
6 import ru
.deadsoftware
.cavecraft
.game
.GameProc
;
8 public class Human
extends Mob
{
10 private RandomXS128 rand
= new RandomXS128();
11 private GameProc gameProc
;
13 public Human(int x
, int y
, GameProc gameProc
) {
14 this.gameProc
= gameProc
;
15 position
= new Vector2(x
, y
);
16 moveX
= new Vector2(0, 0);
17 moveY
= new Vector2(0, 0);
26 if (canJump
&& gameProc
.world
.getForeMap(
27 (int)(position
.x
/16)+(dir
*2-1), (int)(position
.y
/16)+1)>0)
29 if (rand
.nextInt(500)>490) dir
++;
32 moveX
.add(-2+4*dir
, 0);
35 public Rectangle
getRect() {
36 return new Rectangle(position
.x
, position
.y
, width
, height
);