Package squidpony.squidgrid.gui.gdx
Class PanelEffect.ProjectileEffect
java.lang.Object
com.badlogic.gdx.scenes.scene2d.Action
com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
squidpony.squidgrid.gui.gdx.PanelEffect
squidpony.squidgrid.gui.gdx.PanelEffect.ProjectileEffect
- All Implemented Interfaces:
- com.badlogic.gdx.utils.Pool.Poolable
- Direct Known Subclasses:
- PanelEffect.SteadyProjectileEffect
- Enclosing class:
- PanelEffect
public static class PanelEffect.ProjectileEffect extends PanelEffect
- 
Nested Class SummaryNested classes/interfaces inherited from class squidpony.squidgrid.gui.gdx.PanelEffectPanelEffect.ExplosionEffect, PanelEffect.GibberishEffect, PanelEffect.GlowBallEffect, PanelEffect.ProjectileEffect, PanelEffect.PulseEffect, PanelEffect.SteadyProjectileEffect
- 
Field SummaryFields Modifier and Type Field Description Coord[]affectedThe raw list of Coords that might be affected by the projectile, or are on its (potential) path.floatcolorThe color used for the projectile as a packed float; defaults to white.CoordendPointNormally you should set this in the constructor, and not change it later.charshownThe char to show at each stage of the projectile's path; defaults to a Unicode bullet symbol, '·'.CoordstartPointNormally you should set this in the constructor, and not change it later.Fields inherited from class squidpony.squidgrid.gui.gdx.PanelEffectfastInSlowMidFastOut, target, validCells
- 
Constructor SummaryConstructors Constructor Description ProjectileEffect(IPackedColorPanel targeting, float duration, Coord startPoint, Coord endPoint)Constructs a ProjectileEffect with explicit settings for some fields.ProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, Coord endPoint)Constructs a ProjectileEffect with explicit settings for most fields.ProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, 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.ProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, 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, Coord startPoint, Coord endPoint)Constructs a ProjectileEffect with explicit settings for some fields.
- 
Method SummaryModifier and Type Method Description protected voidupdate(float percent)Called each frame.voiduseArcPathInterpolation()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.voiduseStraightPathInterpolation()Makes this ProjectileEffect take a direct path to the target, traveling at uniform speed throughout its path.Methods inherited from class com.badlogic.gdx.scenes.scene2d.actions.TemporalActionact, begin, end, finish, getDuration, getInterpolation, getTime, isComplete, isReverse, reset, restart, setDuration, setInterpolation, setReverse, setTime
- 
Field Details- 
startPointNormally you should set this in the constructor, and not change it later.
- 
endPointNormally you should set this in the constructor, and not change it later.
- 
shownThe char to show at each stage of the projectile's path; defaults to a Unicode bullet symbol, '·'.
- 
colorThe color used for the projectile as a packed float; defaults to white.
- 
affectedThe raw list of Coords that might be affected by the projectile, or are on its (potential) path. You can edit this if you need to, but it isn't recommended; because it is an array you would need to assign a new Coord array if the length changes.
 
- 
- 
Constructor Details- 
ProjectileEffectConstructs a ProjectileEffect with explicit settings for some fields. The valid cells this can affect will be the full expanse of the IPackedColorPanel. The duration will be 1 second.- Parameters:
- targeting- the IPackedColorPanel to affect
- startPoint- the starting point of the projectile; may be best if it is adjacent to whatever fires it
- endPoint- the point to try to hit with the projectile; this should always succeed with no obstructions
 
- 
ProjectileEffectpublic ProjectileEffect(IPackedColorPanel targeting, float duration, Coord startPoint, Coord endPoint)Constructs a ProjectileEffect with explicit settings for some fields. The valid cells this can affect will be the full expanse of the IPackedColorPanel.- Parameters:
- targeting- the IPackedColorPanel to affect
- duration- the duration of this PanelEffect in seconds, as a float
- startPoint- the starting point of the projectile; may be best if it is adjacent to whatever fires it
- endPoint- the point to try to hit with the projectile; this should always succeed with no obstructions
 
- 
ProjectileEffectpublic ProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, Coord endPoint)Constructs a ProjectileEffect with explicit settings for most fields.- Parameters:
- targeting- the IPackedColorPanel to affect
- duration- the duration of this PanelEffect in seconds, as a float
- valid- the valid cells that can be changed by this PanelEffect, as a GreasedRegion
- startPoint- the starting point of the projectile; may be best if it is adjacent to whatever fires it
- endPoint- the point to try to hit with the projectile; this may not be reached if the path crosses a cell not in valid
 
- 
ProjectileEffectpublic ProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, 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.- Parameters:
- targeting- the IPackedColorPanel to affect
- duration- the duration of this PanelEffect in seconds, as a float
- valid- the valid cells that can be changed by this PanelEffect, as a GreasedRegion
- startPoint- the starting point of the projectile; may be best if it is adjacent to whatever fires it
- endPoint- the point to try to hit with the projectile; this may not be reached if the path crosses a cell not in valid
- shown- the char to show at each step of the projectile's path as it advances
- coloring- a Color or subclass thereof that will replace the default white color here
 
- 
ProjectileEffectpublic ProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, 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.- Parameters:
- targeting- the IPackedColorPanel to affect
- duration- the duration of this PanelEffect in seconds, as a float
- valid- the valid cells that can be changed by this PanelEffect, as a GreasedRegion
- startPoint- the starting point of the projectile; may be best if it is adjacent to whatever fires it
- endPoint- the point to try to hit with the projectile; this may not be reached if the path crosses a cell not in valid
- shown- the char to show at each step of the projectile's path as it advances
- coloring- an array of colors as packed floats that will replace the default white color here
 
 
- 
- 
Method Details- 
useArcPathInterpolationMakes 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.
- 
useStraightPathInterpolationMakes this ProjectileEffect take a direct path to the target, traveling at uniform speed throughout its path.
- 
updateCalled each frame.- Specified by:
- updatein class- com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
- Parameters:
- 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.
 
 
-