com.brackeen.javagamebook.tilegame.sprites
Class Player

java.lang.Object
  extended by Sprite
      extended by com.brackeen.javagamebook.tilegame.sprites.Creature
          extended by com.brackeen.javagamebook.tilegame.sprites.Player

public class Player
extends Creature

The Player.


Field Summary
 
Fields inherited from class com.brackeen.javagamebook.tilegame.sprites.Creature
STATE_DEAD, STATE_DYING, STATE_NORMAL
 
Constructor Summary
Player(Animation left, Animation right, Animation deadLeft, Animation deadRight)
           
 
Method Summary
 void collideHorizontal()
          Called before update() if the creature collided with a tile horizontally.
 void collideVertical()
          Called before update() if the creature collided with a tile vertically.
 float getMaxSpeed()
          Gets the maximum speed of this Creature.
 void jump(boolean forceJump)
          Makes the player jump if the player is on the ground or if forceJump is true.
 void setY(float y)
           
 void wakeUp()
          Wakes up the creature when the Creature first appears on screen.
 
Methods inherited from class com.brackeen.javagamebook.tilegame.sprites.Creature
clone, getState, isAlive, isFlying, setState, update
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Player

public Player(Animation left,
              Animation right,
              Animation deadLeft,
              Animation deadRight)
Method Detail

collideHorizontal

public void collideHorizontal()
Description copied from class: Creature
Called before update() if the creature collided with a tile horizontally.

Overrides:
collideHorizontal in class Creature

collideVertical

public void collideVertical()
Description copied from class: Creature
Called before update() if the creature collided with a tile vertically.

Overrides:
collideVertical in class Creature

setY

public void setY(float y)

wakeUp

public void wakeUp()
Description copied from class: Creature
Wakes up the creature when the Creature first appears on screen. Normally, the creature starts moving left.

Overrides:
wakeUp in class Creature

jump

public void jump(boolean forceJump)
Makes the player jump if the player is on the ground or if forceJump is true.


getMaxSpeed

public float getMaxSpeed()
Description copied from class: Creature
Gets the maximum speed of this Creature.

Overrides:
getMaxSpeed in class Creature