DEADSOFTWARE

Add pigs
[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 static int ANIM_SPEED = 6;
13 public Vector2 position;
14 public Vector2 moveX, moveY;
15 public int width, height, dir, texWidth;
16 public boolean canJump;
17 public int[] inventory;
18 public boolean flyMode = false;
20 public Player(Vector2 spawnPoint) {
21 position = spawnPoint.cpy();
22 moveX = new Vector2(0, 0);
23 moveY = new Vector2(0, 0);
24 width = 4;
25 height = 30;
26 texWidth = 8;
27 inventory = new int[9];
28 inventory[0] = 1;
29 inventory[1] = 2;
30 inventory[2] = 3;
31 inventory[3] = 4;
32 inventory[4] = 5;
33 inventory[5] = 6;
34 inventory[6] = 7;
35 inventory[7] = 8;
36 inventory[8] = 9;
37 }
39 public Rectangle getRect() {
40 return new Rectangle(position.x+2, position.y, width, height);
41 }
43 }