DEADSOFTWARE

Complete game save
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / objects / Player.java
1 package ru.deadsoftware.cavecraft.game.objects;
3 import com.badlogic.gdx.math.Rectangle;
4 import com.badlogic.gdx.math.Vector2;
6 import java.io.Serializable;
8 public class Player implements Serializable {
10 public static int ANIM_SPEED = 6;
12 public Vector2 position;
13 public Vector2 moveX, moveY;
14 public int width, height, dir, texWidth;
15 public boolean canJump;
16 public int[] inventory;
17 public boolean flyMode = false;
19 public Player(Vector2 spawnPoint) {
20 position = spawnPoint.cpy();
21 moveX = new Vector2(0, 0);
22 moveY = new Vector2(0, 0);
23 width = 4;
24 height = 30;
25 texWidth = 8;
26 inventory = new int[9];
27 inventory[0] = 1;
28 inventory[1] = 2;
29 inventory[2] = 3;
30 inventory[3] = 4;
31 inventory[4] = 5;
32 inventory[5] = 6;
33 inventory[6] = 7;
34 inventory[7] = 8;
35 inventory[8] = 9;
36 }
38 public Rectangle getRect() {
39 return new Rectangle(position.x+2, position.y, width, height);
40 }
42 }