public class Player
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) float |
animationFrame
This describes the frames of the walking animation of the player while running
|
(package private) boolean |
attacked
This describes weather or not the player has walked on enough tiles of grasses to start a fight
|
(package private) int |
currentHealth
The current amount of hit points that the main character's monster can have
|
int |
direction |
static int |
DOWN |
int |
fightX |
int |
fightY |
(package private) int |
grassesWalked
This field describes how many tiles of glasses the player has walk on
|
(package private) int |
hit
The amount of hit points the a basic attack can hit on others
|
(package private) boolean |
inGrass |
static int |
LEFT |
(package private) boolean |
magicFluteReceived |
boolean |
manageToRun |
(package private) int |
maxHealth
The maximum amount of hit points the main character's monster can have
|
(package private) int |
money |
(package private) boolean |
monsterHitAnimation
This describes weather or not the player monster has finished the attack or power attack animation
|
int |
monsterInitialX |
int |
monsterInitialY |
java.lang.String |
monsterName |
int |
monsterX |
int |
monsterY |
(package private) boolean |
myTurn
This describes weather or not is player turn on a fight
|
int |
originX |
int |
originY |
Pixmap |
playerPixmap
The player is looking on the right, while the game starts
|
(package private) int |
powerHit
The amount of hit points the a power attack can hit on others
|
int |
powerX |
int |
powerY |
static int |
RIGHT |
static float |
speed |
static int |
UP |
(package private) boolean |
usedPower
This describes weather or not the power attack had been used on a single battle
|
int |
x |
int |
y |
Constructor and Description |
---|
Player()
Player Class constructor used to initialise basic values of the player class
|
Modifier and Type | Method and Description |
---|---|
void |
draw(Graphics g,
Pixmap currentPlayerPixmap)
This draw method is use to control which set of sprites are drawn according to the direction that the player is facing.
|
void |
drawHealth(Graphics g)
This simple method just converts integer value of the current health point of the player to strings in order to be able to be prnted
|
public static final int UP
public static final int LEFT
public static final int DOWN
public static final int RIGHT
public static final float speed
public int direction
public int x
public int y
public int fightX
public int fightY
public int originX
public int originY
public boolean manageToRun
public Pixmap playerPixmap
public java.lang.String monsterName
public int monsterX
public int monsterY
public int monsterInitialX
public int monsterInitialY
public int powerX
public int powerY
boolean usedPower
int grassesWalked
boolean magicFluteReceived
boolean attacked
boolean inGrass
float animationFrame
boolean monsterHitAnimation
int hit
int powerHit
int maxHealth
int currentHealth
int money
boolean myTurn
public Player()
public void draw(Graphics g, Pixmap currentPlayerPixmap)
public void drawHealth(Graphics g)