DEADSOFTWARE

Better collision, disable auto jump
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / objects / Player.java
1 package ru.deadsoftware.cavecraft.game.objects;
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.Assets;
7 import ru.deadsoftware.cavecraft.game.WorldGen;
9 public class Player {
11 public Vector2 position;
12 public Vector2 moveX, moveY;
13 public int width, height, dir, texWidth;
14 public boolean canJump;
15 public int[] inventory;
16 public boolean flyMode = false;
18 public Player(int x, int y) {
19 position = new Vector2(x, y);
20 moveX = new Vector2(0, 0);
21 moveY = new Vector2(0, 0);
22 width = 4;
23 height = 30;
24 texWidth = 8;
25 inventory = new int[9];
26 inventory[0] = 1;
27 inventory[1] = 2;
28 inventory[2] = 3;
29 inventory[3] = 4;
30 inventory[4] = 5;
31 inventory[5] = 6;
32 inventory[6] = 7;
33 inventory[7] = 8;
34 inventory[8] = 9;
35 }
37 public Rectangle getRect() {
38 return new Rectangle(position.x+2, position.y, width, height);
39 }
41 }