public abstract class AbstractCharacter extends AbstractEntity
NAMELIST
GAME_DIAGLENGTH, GAME_DIAGLENGTH2, GAME_EDGELENGTH, OBJECTTYPESCOUNT, SCREEN_DEPTH, SCREEN_DEPTH2, SCREEN_DEPTH4, SCREEN_HEIGHT, SCREEN_HEIGHT2, SCREEN_HEIGHT4, SCREEN_WIDTH, SCREEN_WIDTH2, SCREEN_WIDTH4, VALUESCOUNT
Modifier | Constructor and Description |
---|---|
protected |
AbstractCharacter(int id,
int spritesPerDir,
Point point)
Constructor of AbstractCharacter.
|
Modifier and Type | Method and Description |
---|---|
void |
damage(int value) |
void |
dispose()
Deletes the object from the map.
|
AbstractCharacter |
exist()
add this entity to the map-> let it exist
|
abstract com.badlogic.gdx.math.Vector3 |
getAiming()
Defines the direction of the gun - if no gun available - the direction of the head.
|
com.badlogic.gdx.math.Vector3 |
getDirectionVector()
Returns a vector wich contains the movement directions.
|
int |
getHealt() |
int |
getMana() |
boolean |
isInLiquid()
Is the character standing in a liquid?
|
abstract void |
jump()
This method should define what happens when the object jumps.
|
void |
jump(float velo)
Jump with a specific speed
|
boolean |
onGround()
Adds horizontal colission check to onGround().
|
void |
setDamageSounds(com.badlogic.gdx.audio.Sound[] sound) |
void |
setFallingSound(com.badlogic.gdx.audio.Sound fallingSound)
Sets the sound to be played when falling.
|
void |
setJumpingSound(com.badlogic.gdx.audio.Sound jumpingSound)
Set the value of jumpingSound
|
void |
setLandingSound(com.badlogic.gdx.audio.Sound landingSound)
Set sound played when the character lands on the feet.
|
void |
setMana(int mana) |
void |
setRunningSound(com.badlogic.gdx.audio.Sound runningSound)
Set the sound to be played when running.
|
static void |
setWaterSound(com.badlogic.gdx.audio.Sound waterSound)
Set the value of waterSound
|
void |
update(float delta)
Updates the charackter.
|
void |
walk(boolean up,
boolean down,
boolean left,
boolean right,
float walkingspeed)
Lets the player walk.
|
getCategory, getDepth, getName, getPos, setHeight, setPos, shouldBeDisposed
getDimensionZ, getDrawCalls, getId, getLightlevel, getPixmap, getSprite, getSprites, getSpritesheet, getValue, increaseDrawCalls, isClipped, isHidden, isObstacle, isTransparent, loadSheet, prepareColor, render, render, render, render, render, render, render, resetDrawCalls, setClipped, setDimensionZ, setHidden, setLightlevel, setObstacle, setTransparent, setValue, staticDispose, updateStaticUpdates
protected AbstractCharacter(int id, int spritesPerDir, Point point)
id
- spritesPerDir
- The number of animation sprites per walking directionpoint
- public abstract void jump()
jump(float)
public abstract com.badlogic.gdx.math.Vector3 getAiming()
public void jump(float velo)
velo
- the velocity in m/spublic void walk(boolean up, boolean down, boolean left, boolean right, float walkingspeed)
up
- move up?down
- move down?left
- move left?right
- move right?walkingspeed
- the higher the speed the bigger the steps. Should be in m/s.public void update(float delta)
update
in class AbstractGameObject
delta
- time since last updatepublic com.badlogic.gdx.math.Vector3 getDirectionVector()
public void setFallingSound(com.badlogic.gdx.audio.Sound fallingSound)
fallingSound
- public void setRunningSound(com.badlogic.gdx.audio.Sound runningSound)
runningSound
- public void setJumpingSound(com.badlogic.gdx.audio.Sound jumpingSound)
jumpingSound
- new value of jumpingSoundpublic void setLandingSound(com.badlogic.gdx.audio.Sound landingSound)
landingSound
- new value of landingSoundpublic static void setWaterSound(com.badlogic.gdx.audio.Sound waterSound)
waterSound
- new value of waterSoundpublic void setDamageSounds(com.badlogic.gdx.audio.Sound[] sound)
sound
- public boolean onGround()
onGround
in class AbstractEntity
public AbstractCharacter exist()
AbstractEntity
exist
in class AbstractEntity
public boolean isInLiquid()
public void damage(int value)
value
- public int getHealt()
public int getMana()
public void setMana(int mana)
mana
- public void dispose()
AbstractEntity
dispose
in class AbstractEntity