|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object group1.model.gameobject.GameObj group1.model.gameobject.LivingObj group1.model.gameobject.enemy.Enemy
public class Enemy
Enemy
is a living enemy in the game. Unlike Jeff, who moves
based on user input, an Enemy moves based on its own personal desires
determined by a random value generator.
Field Summary | |
---|---|
static int |
ATTACK_PROBABILITY_DENOMINATOR
The probability that this Enemy will attack at a particular time step is ATTACK_PROBABILITY_NUMERATOR out of ATTACK_PROBABILITY_DENOMINATOR. |
static int |
ATTACK_PROBABILITY_NUMERATOR
The probability that this Enemy will attack at a particular time step is ATTACK_PROBABILITY_NUMERATOR out of ATTACK_PROBABILITY_DENOMINATOR. |
static int |
CHANGE_WEAPON_PROBABILITY_DENOMINATOR
The probability that this Enemy will change weapons at a particular time step is CHANGE_WEAPON_PROBABILITY_NUMERATOR out of CHANGE_WEAPON_PROBABILITY_DENOMINATOR. |
static int |
CHANGE_WEAPON_PROBABILITY_NUMERATOR
The probability that this Enemy will change weapons at a particular time step is CHANGE_WEAPON_PROBABILITY_NUMERATOR out of CHANGE_WEAPON_PROBABILITY_DENOMINATOR. |
static double |
DEFAULT_ATTACK_POWER
The default attack power. |
static double |
DEFAULT_PROJECTILE_SPEED
The default speed of projectiles created by this Enemy. |
static double |
DEFAULT_WALK_SPEED
The default walk speed. |
static double |
MAX_WALK_SPEED
The maximum walking speed. |
static int |
STARTING_HP
Enemy's starting maximum hit points. |
static double |
WALK_ACCELERATION
The acceleration while walking. |
Fields inherited from class group1.model.gameobject.LivingObj |
---|
contactDamageMultiplier, curr_hp, fireDamageMultiplier, katanaDamageMultiplier, laserDamageMultiplier, max_hp, tomahawkDamageMultiplier, VALID_WEAPON_CODES |
Fields inherited from class group1.model.gameobject.GameObj |
---|
acceleration, ENEMY_TEAM, GRID_SPACE_SIZE, id, isMovable, JEFF_TEAM, NO_TEAM, regions, shape, velocity |
Constructor Summary | |
---|---|
Enemy()
Default constructor. |
|
Enemy(double x,
double y,
PictureList p)
Constructor. |
Method Summary | |
---|---|
java.util.Random |
getRandomGenerator()
Returns the random value generator that this Enemy is using. |
XYPair |
move(Environment env)
Movement function that should be called by the Environment at each time click. |
void |
setRandomGenerator(java.util.Random newGenerator)
Set this Enemy object to use another random value generator. |
Methods inherited from class group1.model.gameobject.LivingObj |
---|
changeWeapon, die, getCurrentWeapon, getCurrHP, getMaxHP, hasFireball, hasKatana, hasLaser, hasTomahawk, hasWeapon, hasWeaponIndex, takeDamage |
Methods inherited from class group1.model.gameobject.GameObj |
---|
addRegion, addRegion, equals, getAcceleration, getAccelerationX, getAccelerationY, getFilm, getFilm, getHeight, getID, getNumRegions, getPictureList, getPosition, getPositionX, getPositionY, getRectangle, getRegion, getState, getTeam, getVelocity, getVelocityX, getVelocityY, getWidth, intersectRegions, isMovable, isSameState, makeRegions, makeSolid, makeSolidTop, setAcceleration, setAcceleration, setAccelerationX, setAccelerationY, setID, setPictureList, setPosition, setPosition, setPositionX, setPositionY, setRectangle, setSize, setState, setTeam, setVelocity, setVelocity, setVelocityX, setVelocityY, stopHorizontal, stopVertical |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STARTING_HP
public static final int ATTACK_PROBABILITY_NUMERATOR
public static final int ATTACK_PROBABILITY_DENOMINATOR
public static final int CHANGE_WEAPON_PROBABILITY_NUMERATOR
public static final int CHANGE_WEAPON_PROBABILITY_DENOMINATOR
public static final double MAX_WALK_SPEED
public static final double WALK_ACCELERATION
public static final double DEFAULT_WALK_SPEED
public static final double DEFAULT_ATTACK_POWER
public static final double DEFAULT_PROJECTILE_SPEED
Constructor Detail |
---|
public Enemy(double x, double y, PictureList p)
x
- The x-coordinate of the position.y
- The y-coordinate of the position.public Enemy()
Method Detail |
---|
public java.util.Random getRandomGenerator()
public void setRandomGenerator(java.util.Random newGenerator)
public XYPair move(Environment env)
move
in class GameObj
env
- The environment that this object is moving in.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |