public abstract class Effect
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
boolean |
applyScore |
protected java.awt.Rectangle |
collision
Collision for batches
|
boolean |
count |
boolean |
countElse |
java.lang.String |
counter |
java.lang.String |
counterElse |
boolean |
enabled
Indicates if this effect is enabled or not (default: true)
|
long |
hashCode
'Unique' hashcode for this effect
|
boolean |
inBatch
Indicates if the effect wishes to take into account all sprites of the second type at once.
|
boolean |
is_kill_effect |
boolean |
is_stochastic |
double |
prob |
int |
repeat |
java.lang.String |
scoreChange |
boolean |
sequential |
Constructor and Description |
---|
Effect() |
Modifier and Type | Method and Description |
---|---|
protected java.awt.Rectangle |
calculatePixelPerfect(VGDLSprite sprite1,
VGDLSprite sprite2) |
protected boolean[] |
determineCollision(VGDLSprite sprite1,
java.awt.Rectangle s2rect,
Game g)
Determines if the collision is horizontal and/or vertical
|
abstract void |
execute(VGDLSprite sprite1,
VGDLSprite sprite2,
Game game)
Executes the effect
|
int |
executeBatch(VGDLSprite sprite1,
java.util.ArrayList<VGDLSprite> sprite2list,
Game game)
Executes the effect to all second sprites at once.
|
int |
getCounter(int idx) |
int |
getCounterElse(int idx) |
java.util.ArrayList<java.lang.String> |
getEffectSprites() |
int |
getScoreChange(int playerID)
Determine score change for specific player
|
void |
parseParameters(InteractionContent content) |
void |
setStochastic() |
int |
sortBatch(VGDLSprite sprite1,
java.util.ArrayList<VGDLSprite> sprite2list,
Game game)
Takes a batch of sprites to collide against at once, and builds the collision boundary with them.
|
public boolean is_kill_effect
public boolean is_stochastic
public boolean sequential
public java.lang.String scoreChange
public boolean count
public java.lang.String counter
public boolean countElse
public java.lang.String counterElse
public double prob
public boolean applyScore
public int repeat
public long hashCode
public boolean enabled
public boolean inBatch
protected java.awt.Rectangle collision
public abstract void execute(VGDLSprite sprite1, VGDLSprite sprite2, Game game)
sprite1
- first sprite of the collisionsprite2
- second sprite of the collisiongame
- reference to the game object with the current state.public int executeBatch(VGDLSprite sprite1, java.util.ArrayList<VGDLSprite> sprite2list, Game game)
sprite1
- first sprite of the collisionsprite2list
- list of all second sprites of the collisiongame
- reference to the game object with the current state.public int sortBatch(VGDLSprite sprite1, java.util.ArrayList<VGDLSprite> sprite2list, Game game)
sprite1
- Sprite that collides with the batchsprite2list
- Sprites to collide against.game
- our game.protected boolean[] determineCollision(VGDLSprite sprite1, java.awt.Rectangle s2rect, Game g)
sprite1
- Sprite collidings2rect
- Collision colliding against.g
- gamepublic void setStochastic()
public void parseParameters(InteractionContent content)
public int getScoreChange(int playerID)
playerID
- - player affectedpublic int getCounter(int idx)
public int getCounterElse(int idx)
public java.util.ArrayList<java.lang.String> getEffectSprites()
protected java.awt.Rectangle calculatePixelPerfect(VGDLSprite sprite1, VGDLSprite sprite2)