|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgroup1.model.gameobject.GameObj
group1.model.gameobject.projectile.Projectile
public class Projectile
A Projectile is a flying object that directly gives damage to another game object. Projectiles are emitted by Jeff or enemies as weapons.
Usage: construct the Projectile, then set its attack power, speed, and direction.
| Field Summary |
|---|
| Fields inherited from class group1.model.gameobject.GameObj |
|---|
acceleration, ENEMY_TEAM, GRID_SPACE_SIZE, id, isMovable, JEFF_TEAM, myState, NO_TEAM, regions, shape, THICKNESS, velocity |
| Constructor Summary | |
|---|---|
Projectile()
Creates an idle Projectile. |
|
Projectile(double x,
double y,
PictureList p)
Creates an idle Projectile. |
|
| Method Summary | |
|---|---|
ObjRegion |
findObjRegion(int side)
Finds an occurrence of an ObjRegion for this object that is on the specified side. |
double |
getAttackPower()
Returns the attack power of the Projectile, which is the amount of damage that it gives to a GameObj that it hits. |
ObjRegion |
getBottomObjRegion()
Returns the ObjRegion on the bottom side of the Projectile that gives damage. |
char |
getDamageType()
Returns a letter code indicating the type of damage that this Projectile gives. |
Direction |
getDirection()
Returns the horizontal direction of the Projectile. |
ObjRegion |
getLeftObjRegion()
Returns the ObjRegion on the left side of the Projectile that gives damage. |
ObjRegion |
getRightObjRegion()
Returns the ObjRegion on the right side of the Projectile that gives damage. |
double |
getSpeed()
Returns the speed (magnitude of velocity) of the Projectile. |
ObjRegion |
getTopObjRegion()
Returns the ObjRegion on the top side of the Projectile that gives damage. |
XYPair |
getVelocityVector()
Gives the current velocity vector of the Projectile, based on its current speed and direction. |
XYPair |
move(Environment env)
Movement function that should be called by the Environment at each time click. |
void |
setAttackPower(double newAttackPower)
Sets this Projectile to give the specified amount of damage. |
void |
setDirection(Direction newDirection)
Sets the horizontal direction of this Projectile. |
void |
setProjectileTeam(int teamValue)
setTeam(int) in GameObj is protected !!!!!!!!!! This function allows Jeff or an enemy to set the team of its Projectile to its own. |
void |
setSpeed(double newSpeed)
Sets the speed (magnitude of velocity) of this Projectile. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Projectile()
public Projectile(double x,
double y,
PictureList p)
| Method Detail |
|---|
public char getDamageType()
public double getAttackPower()
public Direction getDirection()
public double getSpeed()
public ObjRegion getLeftObjRegion()
public ObjRegion getRightObjRegion()
public ObjRegion getTopObjRegion()
public ObjRegion getBottomObjRegion()
public XYPair getVelocityVector()
public ObjRegion findObjRegion(int side)
side - Constant from ObjRegion denoting which side the
ObjRegion is on.
public void setAttackPower(double newAttackPower)
public void setDirection(Direction newDirection)
public void setSpeed(double newSpeed)
public XYPair move(Environment env)
move in class GameObjenv - The environment that this object is moving in.
public void setProjectileTeam(int teamValue)
LivingObj's have a mind of their own, and you have no right to brainwash them, but Projectile's DO NOT have minds of their own; they are slaves to their users!
teamValue - The team value: NO_TEAM, JEFF_TEAM, or ENEMY_TEAM.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||