public static class PanelEffect.ProjectileEffect extends PanelEffect
PanelEffect.ExplosionEffect, PanelEffect.GibberishEffect, PanelEffect.GlowBallEffect, PanelEffect.ProjectileEffect, PanelEffect.PulseEffect, PanelEffect.SteadyProjectileEffect
Modifier and Type | Field and Description |
---|---|
squidpony.squidmath.Coord[] |
affected
The raw list of Coords that might be affected by the projectile, or are on its (potential) path.
|
float |
color
The color used for the projectile as a packed float; defaults to white.
|
squidpony.squidmath.Coord |
endPoint
Normally you should set this in the constructor, and not change it later.
|
char |
shown
The char to show at each stage of the projectile's path; defaults to a Unicode bullet symbol, '·'.
|
squidpony.squidmath.Coord |
startPoint
Normally you should set this in the constructor, and not change it later.
|
fastInSlowMidFastOut, target, validCells
Constructor and Description |
---|
ProjectileEffect(IPackedColorPanel targeting,
squidpony.squidmath.Coord startPoint,
squidpony.squidmath.Coord endPoint)
Constructs a ProjectileEffect with explicit settings for some fields.
|
ProjectileEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.Coord startPoint,
squidpony.squidmath.Coord endPoint)
Constructs a ProjectileEffect with explicit settings for some fields.
|
ProjectileEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.GreasedRegion valid,
squidpony.squidmath.Coord startPoint,
squidpony.squidmath.Coord endPoint)
Constructs a ProjectileEffect with explicit settings for most fields.
|
ProjectileEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.GreasedRegion valid,
squidpony.squidmath.Coord startPoint,
squidpony.squidmath.Coord endPoint,
char shown,
com.badlogic.gdx.graphics.Color coloring)
Constructs a ProjectileEffect with explicit settings for most fields but also an alternate Color
object for the projectile instead of the default white color.
|
ProjectileEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.GreasedRegion valid,
squidpony.squidmath.Coord startPoint,
squidpony.squidmath.Coord endPoint,
char shown,
float coloring)
Constructs a ProjectileEffect with explicit settings for most fields but also an alternate Color
object for the projectile instead of the default white color.
|
Modifier and Type | Method and Description |
---|---|
protected void |
update(float percent)
Called each frame.
|
void |
useArcPathInterpolation()
Makes this ProjectileEffect take an "arc-like" path toward the target, where it is fast at the
beginning and end of its motion and is reaching the height of its arc at the center.
|
void |
useStraightPathInterpolation()
Makes this ProjectileEffect take a direct path to the target, traveling at uniform speed throughout its path.
|
makeGrenadeEffect
act, begin, end, finish, getDuration, getInterpolation, getTime, isComplete, isReverse, reset, restart, setDuration, setInterpolation, setReverse, setTime
public squidpony.squidmath.Coord startPoint
public squidpony.squidmath.Coord endPoint
public char shown
public float color
public squidpony.squidmath.Coord[] affected
public ProjectileEffect(IPackedColorPanel targeting, squidpony.squidmath.Coord startPoint, squidpony.squidmath.Coord endPoint)
targeting
- the IPackedColorPanel to affectstartPoint
- the starting point of the projectile; may be best if it is adjacent to whatever fires itendPoint
- the point to try to hit with the projectile; this should always succeed with no obstructionspublic ProjectileEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.Coord startPoint, squidpony.squidmath.Coord endPoint)
targeting
- the IPackedColorPanel to affectduration
- the duration of this PanelEffect in seconds, as a floatstartPoint
- the starting point of the projectile; may be best if it is adjacent to whatever fires itendPoint
- the point to try to hit with the projectile; this should always succeed with no obstructionspublic ProjectileEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.GreasedRegion valid, squidpony.squidmath.Coord startPoint, squidpony.squidmath.Coord endPoint)
targeting
- the IPackedColorPanel to affectduration
- the duration of this PanelEffect in seconds, as a floatvalid
- the valid cells that can be changed by this PanelEffect, as a GreasedRegionstartPoint
- the starting point of the projectile; may be best if it is adjacent to whatever fires itendPoint
- the point to try to hit with the projectile; this may not be reached if the path crosses a cell not in validpublic ProjectileEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.GreasedRegion valid, squidpony.squidmath.Coord startPoint, squidpony.squidmath.Coord endPoint, char shown, com.badlogic.gdx.graphics.Color coloring)
targeting
- the IPackedColorPanel to affectduration
- the duration of this PanelEffect in seconds, as a floatvalid
- the valid cells that can be changed by this PanelEffect, as a GreasedRegionstartPoint
- the starting point of the projectile; may be best if it is adjacent to whatever fires itendPoint
- the point to try to hit with the projectile; this may not be reached if the path crosses a cell not in validshown
- the char to show at each step of the projectile's path as it advancescoloring
- a Color or subclass thereof that will replace the default white color herepublic ProjectileEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.GreasedRegion valid, squidpony.squidmath.Coord startPoint, squidpony.squidmath.Coord endPoint, char shown, float coloring)
targeting
- the IPackedColorPanel to affectduration
- the duration of this PanelEffect in seconds, as a floatvalid
- the valid cells that can be changed by this PanelEffect, as a GreasedRegionstartPoint
- the starting point of the projectile; may be best if it is adjacent to whatever fires itendPoint
- the point to try to hit with the projectile; this may not be reached if the path crosses a cell not in validshown
- the char to show at each step of the projectile's path as it advancescoloring
- an array of colors as packed floats that will replace the default white color herepublic void useArcPathInterpolation()
public void useStraightPathInterpolation()
protected void update(float percent)
update
in class com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
percent
- The percentage of completion for this action, growing from 0 to 1 over the duration. If
reversed
, this will shrink from 1 to 0.Copyright © Eben Howard 2012–2022. All rights reserved.