|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.games.zombieland.weapons.Weapon
public abstract class Weapon
Weapon class. Sets up the basic functions of a weapon and allows for customization in how a weapon produces bullets.
Constructor Summary | |
---|---|
Weapon(Shooter shooter,
int ammo)
|
|
Weapon(Shooter shooter,
int ammo,
int dmg,
double speed,
int delay)
|
Method Summary | |
---|---|
void |
addAmmo(int ammo)
Add ammo. |
void |
fire()
Checks if there's ammo left. |
protected abstract void |
fireBullets()
Specifies how and how many bullets are created every time the weapon fires. |
int |
getAmmo()
Get the remaining ammo. |
double |
getDamage()
Get the weapon damage. |
double |
getOrientation()
Get the orientation of the player/weapon |
protected void |
makeBullet(double angle)
Creates a bullet whose orientation is specified by angle |
void |
setBulletSpeed(double speed)
Set bullet speed |
void |
setDamage(int weaponDamage)
Set weapon damage |
void |
setFiringDelay(int delay)
Set firing delay |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Weapon(Shooter shooter, int ammo)
public Weapon(Shooter shooter, int ammo, int dmg, double speed, int delay)
Method Detail |
---|
public void addAmmo(int ammo)
ammo
- additional ammopublic int getAmmo()
public void setDamage(int weaponDamage)
weaponDamage
- public void setFiringDelay(int delay)
delay
- public void setBulletSpeed(double speed)
speed
- public double getOrientation()
public double getDamage()
public void fire()
protected abstract void fireBullets()
protected void makeBullet(double angle)
angle
- orientation of the bullet to be created
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |