|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.golden.gamedev.object.Sprite
vooga.engine.core.BetterSprite
vooga.examples.networking.zombies.Shooter
public class Shooter
Player class. Contains all properties and abilities of the player
Field Summary |
---|
Fields inherited from interface vooga.examples.networking.zombies.Constants |
---|
ATTACKDOWN, ATTACKLEFT, ATTACKRIGHT, ATTACKUP, DEATH, DEFAULT_RESOURCE_DIRECTORY, GAME_HEIGHT, GAME_WIDTH, MAIN_CLASS, PLAYER_CLASS, PLAYER_DOWN, PLAYER_LEFT, PLAYER_RIGHT, PLAYER_UP, RESOURCE_FILENAME, STATES_XML_PATH, XML_PATH, ZOMBIE_DOWN, ZOMBIE_LEFT, ZOMBIE_RIGHT, ZOMBIE_UP |
Constructor Summary | |
---|---|
Shooter()
|
Method Summary | |
---|---|
void |
addAmmo(int weapon,
int amount)
Add ammo to a weapon |
void |
addBulletToGame(Bullet bullet)
Add a bullet sprite to the game world. |
int |
getAmmo()
Gets the remaining ammo count on the current weapon |
Stat<java.lang.Integer> |
getHealth()
Get the health stat object |
int |
getLevelScore()
Get the player's score for the current level. |
double |
getOrientation()
Get the direction the player is facing (in degrees) |
Stat<java.lang.Integer> |
getScore()
Get the score stat object |
Stat<java.lang.Integer> |
getStatAmmo()
Get the ammo as an object that's able to be displayed using overlays |
void |
goDown()
Move the shooter down and play the corresponding animation. |
void |
goLeft()
Move the shooter left and play the corresponding animation. |
void |
goRight()
Move the shooter right and play the corresponding animation. |
void |
goUp()
Move the shooter up and play the corresponding animation. |
boolean |
healthIsZero()
Checks the player's health to see if he's still alive |
void |
resetLevelScore()
Resets the score so that it can start counting new level's score from 0. |
void |
setAmmo()
|
void |
setBulletListener(IEventHandler bulletlistener)
This method sets the bullet listener for the player |
void |
setHealth(int number)
Set health of the shooter |
void |
shoot()
Initiate the shooting animation and fire bullets according to weapon choice |
void |
switchWeapons(int choice)
|
void |
update(long elapsedTime)
Update the shooter's image. |
void |
updateHealth(double d)
update the health of the shooter |
void |
updateScore(int number)
update score |
Methods inherited from class vooga.engine.core.BetterSprite |
---|
addAnimatedImages, addHorizontalSpeed, addImage, addSprite, addVerticalSpeed, firstRun, forceX, forceY, getCurrentSprite, getDistance, getDoubleStat, getHeight, getHorizontalSpeed, getImage, getIntStat, getStat, getTimeInExistence, getVerticalSpeed, getWidth, getX, getY, isActive, isOnScreen, move, moveTo, moveX, moveY, render, setActive, setAsRenderedSprite, setBackground, setDoubleStat, setHorizontalSpeed, setImage, setImages, setIntStat, setLayer, setLocation, setMovement, setSpeed, setStat, setVerticalSpeed, setX, setY |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Shooter()
Method Detail |
---|
public void setBulletListener(IEventHandler bulletlistener)
bulletlistener
- public void addBulletToGame(Bullet bullet)
bullet
- a bulletangle
- the angle of the bullet's trajectorypublic void goLeft()
public void goRight()
public void goUp()
public void goDown()
public void switchWeapons(int choice)
public void shoot()
public void setAmmo()
public int getAmmo()
public void addAmmo(int weapon, int amount)
weapon
- amount
- public Stat<java.lang.Integer> getStatAmmo()
public double getOrientation()
public boolean healthIsZero()
public void setHealth(int number)
public void updateHealth(double d)
d
- public Stat<java.lang.Integer> getHealth()
public Stat<java.lang.Integer> getScore()
public void resetLevelScore()
public int getLevelScore()
public void updateScore(int number)
public void update(long elapsedTime)
update
in class BetterSprite
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |