Package squidpony.squidgrid.gui.gdx
Class PanelEffect.SteadyProjectileEffect
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
squidpony.squidgrid.gui.gdx.PanelEffect.SteadyProjectileEffect
- All Implemented Interfaces:
com.badlogic.gdx.utils.Pool.Poolable
- Enclosing class:
- PanelEffect
public static class PanelEffect.SteadyProjectileEffect extends PanelEffect.ProjectileEffect
Almost exactly lke
PanelEffect.ProjectileEffect
, but its duration specifies the amount of time to spend crossing each
cell (in seconds), not the duration of the entire effect. For ranged weapons like arrows, a fixed duration for
the effect (as in ProjectileEffect) would mean an arrow shot at a close-by target travels slowly and an arrow
shot at a far-away target travels very quickly; this class avoids that issue. Note that the time spent by the
whole effect will vary based on the Chebyshev distance between the start and end points. The speed the projectile
travels at is also dependent on the size and aspect ratio of cells it travels over.-
Nested Class Summary
Nested classes/interfaces inherited from class squidpony.squidgrid.gui.gdx.PanelEffect
PanelEffect.ExplosionEffect, PanelEffect.GibberishEffect, PanelEffect.GlowBallEffect, PanelEffect.ProjectileEffect, PanelEffect.PulseEffect, PanelEffect.SteadyProjectileEffect
-
Field Summary
Fields inherited from class squidpony.squidgrid.gui.gdx.PanelEffect.ProjectileEffect
affected, color, endPoint, shown, startPoint
Fields inherited from class squidpony.squidgrid.gui.gdx.PanelEffect
fastInSlowMidFastOut, target, validCells
-
Constructor Summary
Constructors Constructor Description SteadyProjectileEffect(IPackedColorPanel targeting, float duration, Coord startPoint, Coord endPoint)
Constructs a SteadyProjectileEffect with explicit settings for some fields.SteadyProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, Coord endPoint)
Constructs a SteadyProjectileEffect with explicit settings for most fields.SteadyProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, Coord endPoint, char shown, float coloring)
Constructs a SteadyProjectileEffect with explicit settings for most fields but also an alternate Color object for the projectile instead of the default white color.SteadyProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, Coord endPoint, char shown, com.badlogic.gdx.graphics.Color coloring)
Constructs a SteadyProjectileEffect with explicit settings for most fields but also an alternate Color object for the projectile instead of the default white color.SteadyProjectileEffect(IPackedColorPanel targeting, Coord startPoint, Coord endPoint)
Constructs a SteadyProjectileEffect with explicit settings for some fields. -
Method Summary
Methods inherited from class squidpony.squidgrid.gui.gdx.PanelEffect.ProjectileEffect
update, useArcPathInterpolation, useStraightPathInterpolation
Methods inherited from class com.badlogic.gdx.scenes.scene2d.actions.TemporalAction
act, begin, end, finish, getDuration, getInterpolation, getTime, isComplete, isReverse, reset, restart, setDuration, setInterpolation, setReverse, setTime
-
Constructor Details
-
SteadyProjectileEffect
Constructs a SteadyProjectileEffect with explicit settings for some fields. The valid cells this can affect will be the full expanse of the IPackedColorPanel. The duration will be 0.05 seconds per cell crossed.- Parameters:
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 obstructions
-
SteadyProjectileEffect
public SteadyProjectileEffect(IPackedColorPanel targeting, float duration, Coord startPoint, Coord endPoint)Constructs a SteadyProjectileEffect 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 affectduration
- the time the projectile will take to cross one cell, 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 obstructions
-
SteadyProjectileEffect
public SteadyProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, Coord endPoint)Constructs a SteadyProjectileEffect with explicit settings for most fields.- Parameters:
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 valid
-
SteadyProjectileEffect
public SteadyProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, Coord endPoint, char shown, com.badlogic.gdx.graphics.Color coloring)Constructs a SteadyProjectileEffect 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 affectduration
- the time the projectile will take to cross one cell, 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 here
-
SteadyProjectileEffect
public SteadyProjectileEffect(IPackedColorPanel targeting, float duration, GreasedRegion valid, Coord startPoint, Coord endPoint, char shown, float coloring)Constructs a SteadyProjectileEffect 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 affectduration
- the time the projectile will take to cross one cell, 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 here
-