public class AlternateChaser extends RandomNPC
Modifier and Type | Field and Description |
---|---|
boolean |
fleeing |
int[] |
itype1 |
int[] |
itype2 |
java.lang.String |
stype1 |
java.lang.String |
stype2 |
cons, counter, prevAction
autotiling, bucket, bucketSharp, color, cooldown, currentFrame, draw_arrow, frameRate, frameRemaining, friction, gravity, healthPoints, hidden, hMult, image, images, img, invisible, is_avatar, is_from_avatar, is_npc, is_oriented, is_resource, is_static, is_stochastic, isFirstTick, itypes, jump_strength, lastmove, lastrect, limitHealthPoints, mass, max_speed, maxHealthPoints, name, on_ground, only_active, orientation, orientedImg, physics, physicstype, portal, randomtiling, rect, resources, rotateInPlace, rotation, shrinkfactor, singleton, size, solid, speed, spriteID, stationary, timeToLive, wMult
Constructor and Description |
---|
AlternateChaser() |
AlternateChaser(Vector2d position,
java.awt.Dimension size,
SpriteContent cnt) |
Modifier and Type | Method and Description |
---|---|
protected void |
closestTargets(Game game,
boolean randomTarget)
Sets a list with the closest targets (sprites with the type 'stype'), by distance
|
VGDLSprite |
copy()
Creates a copy of this sprite.
|
void |
copyTo(VGDLSprite target)
Copies the attributes of this object to the one passed as parameter.
|
java.util.ArrayList<java.lang.String> |
getDependentSprites()
Get all sprites that affect or being affected by the current sprite
|
protected void |
loadDefaults()
Loads the default values for this sprite.
|
protected void |
movesToward(VGDLSprite target) |
void |
postProcess()
Method to perform post processing when the sprite has received its parameters.
|
void |
update(Game game)
Updates this sprite, performing the movements and actions for the next step.
|
getRandomMove
_draw, _drawHealthBar, _drawImage, _drawOriented, _drawResources, _updateOrientation, _updatePos, _updateRotation, _velocity, draw, equiv, getAmountResource, getLastPosition, getPosition, getType, groundIntersects, init, intersects, is_disabled, lastDirection, loadImage, modifyResource, parseParameters, preMovement, removeResource, setDisabled, setFromAvatar, setRect, setRect, subtractResource, toString, updateAvatar, updateBucket, updatePassive
public boolean fleeing
public java.lang.String stype1
public java.lang.String stype2
public int[] itype1
public int[] itype2
public AlternateChaser()
public AlternateChaser(Vector2d position, java.awt.Dimension size, SpriteContent cnt)
protected void loadDefaults()
VGDLSprite
loadDefaults
in class RandomNPC
public void postProcess()
VGDLSprite
postProcess
in class VGDLSprite
public void update(Game game)
VGDLSprite
protected void movesToward(VGDLSprite target)
protected void closestTargets(Game game, boolean randomTarget)
game
- game to access all spritesrandomTarget
- if true, a random target is added to 'targets'. Otherwise, only the closest one is.public VGDLSprite copy()
VGDLSprite
public void copyTo(VGDLSprite target)
VGDLSprite
public java.util.ArrayList<java.lang.String> getDependentSprites()
VGDLSprite
getDependentSprites
in class VGDLSprite