public static class PanelEffect.ExplosionEffect extends PanelEffect
PanelEffect.ExplosionEffect, PanelEffect.GibberishEffect, PanelEffect.GlowBallEffect, PanelEffect.ProjectileEffect, PanelEffect.PulseEffect, PanelEffect.SteadyProjectileEffect
Modifier and Type | Field and Description |
---|---|
java.util.List<squidpony.squidmath.Coord> |
affected
The raw list of Coords that might be affected by the explosion; may include some cells that aren't going to
show as exploding (it usually has some false positives), but shouldn't exclude any cells that should show as
such (no false negatives).
|
squidpony.squidmath.Coord |
center
Normally you should set this in the constructor, and not change it later.
|
float[] |
colors
The default explosion colors are normal for (non-chemical, non-electrical) fire and smoke, going from orange
at the start to yellow, very light yellow, and then back to a different orange before going to smoke and
fading out to translucent and then transparent by the end.
|
double[][] |
lightMap
The internal representation of how affected each cell is by the explosion, based on proximity to center.
|
int |
radius
Normally you should set this in the constructor, and not change it later.
|
fastInSlowMidFastOut, target, validCells
Constructor and Description |
---|
ExplosionEffect(IPackedColorPanel targeting,
squidpony.squidmath.Coord center,
int radius)
Constructs an ExplosionEffect with explicit settings for some fields.
|
ExplosionEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.Coord center,
int radius)
Constructs an ExplosionEffect with explicit settings for some fields.
|
ExplosionEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.GreasedRegion valid,
squidpony.squidmath.Coord center,
int radius)
Constructs an ExplosionEffect with explicit settings for most fields.
|
ExplosionEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.GreasedRegion valid,
squidpony.squidmath.Coord center,
int radius,
double angle,
double span)
Constructs an ExplosionEffect with explicit settings for most fields; this constructor allows the case where
an explosion is directed in a cone or sector shape.
|
ExplosionEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.GreasedRegion valid,
squidpony.squidmath.Coord center,
int radius,
double angle,
double span,
float[] coloring)
Constructs an ExplosionEffect with explicit settings for most fields but also an alternate group of Color
objects that it will use to color the explosion instead of using fiery/smoke colors; this constructor allows
the case where an explosion is directed in a cone or sector shape.
|
ExplosionEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.GreasedRegion valid,
squidpony.squidmath.Coord center,
int radius,
double angle,
double span,
java.util.List<? extends com.badlogic.gdx.graphics.Color> coloring)
Constructs an ExplosionEffect with explicit settings for most fields but also an alternate group of Color
objects that it will use to color the explosion instead of using fiery/smoke colors; this constructor allows
the case where an explosion is directed in a cone or sector shape.
|
ExplosionEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.GreasedRegion valid,
squidpony.squidmath.Coord center,
int radius,
float[] coloring)
Constructs an ExplosionEffect with explicit settings for most fields but also an alternate group of Color
objects that it will use to color the explosion instead of using fiery/smoke colors.
|
ExplosionEffect(IPackedColorPanel targeting,
float duration,
squidpony.squidmath.GreasedRegion valid,
squidpony.squidmath.Coord center,
int radius,
java.util.List<? extends com.badlogic.gdx.graphics.Color> coloring)
Constructs an ExplosionEffect with explicit settings for most fields but also an alternate group of Color
objects that it will use to color the explosion instead of using fiery/smoke colors.
|
Modifier and Type | Method and Description |
---|---|
protected void |
update(float percent)
Called each frame.
|
PanelEffect.ExplosionEffect |
useElectricColors()
Sets the colors this ExplosionEffect uses to go from through various shades of gray-purple before fading.
|
PanelEffect.ExplosionEffect |
useFieryColors()
Sets the colors this ExplosionEffect uses to go from orange, to yellow, to orange, to dark gray, then fade.
|
makeGrenadeEffect
act, begin, end, finish, getDuration, getInterpolation, getTime, isComplete, isReverse, reset, restart, setDuration, setInterpolation, setReverse, setTime
public squidpony.squidmath.Coord center
public int radius
public float[] colors
Color.toFloatBits()
or possibly the result of mixing multiple existing floats with
SColor.lerpFloatColors(float, float, float)
; other floats that can be directly used by libGDX, that
is, packed as ABGR floats (usually the docs will call this a packed float), can also be used.public double[][] lightMap
public java.util.List<squidpony.squidmath.Coord> affected
public ExplosionEffect(IPackedColorPanel targeting, squidpony.squidmath.Coord center, int radius)
targeting
- the IPackedColorPanel to affectcenter
- the center of the explosionradius
- the radius of the explosion, in cellspublic ExplosionEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.Coord center, int radius)
targeting
- the IPackedColorPanel to affectduration
- the duration of this PanelEffect in seconds, as a floatcenter
- the center of the explosionradius
- the radius of the explosion, in cellspublic ExplosionEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.GreasedRegion valid, squidpony.squidmath.Coord center, int radius)
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 GreasedRegioncenter
- the center of the explosionradius
- the radius of the explosion, in cellspublic ExplosionEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.GreasedRegion valid, squidpony.squidmath.Coord center, int radius, java.util.List<? extends 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 GreasedRegioncenter
- the center of the explosionradius
- the radius of the explosion, in cellscoloring
- a List of Color or subclasses thereof that will replace the default fire/smoke colors herepublic ExplosionEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.GreasedRegion valid, squidpony.squidmath.Coord center, int radius, 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 GreasedRegioncenter
- the center of the explosionradius
- the radius of the explosion, in cellscoloring
- an array of colors as packed floats that will replace the default fire/smoke colors herepublic ExplosionEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.GreasedRegion valid, squidpony.squidmath.Coord center, int radius, double angle, double span)
angle
(in degrees)
and will cover an amount of the circular area (in degrees) equal to span
.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 GreasedRegioncenter
- the center of the explosionradius
- the radius of the explosion, in cellsangle
- the angle, in degrees, that will be the center of the sector-shaped effectspan
- the span, in degrees, of the full arc at the end of the sector-shaped effectpublic ExplosionEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.GreasedRegion valid, squidpony.squidmath.Coord center, int radius, double angle, double span, java.util.List<? extends com.badlogic.gdx.graphics.Color> coloring)
angle
(in degrees) and will cover an amount of the circular area (in degrees) equal to span
.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 GreasedRegioncenter
- the center of the explosionradius
- the radius of the explosion, in cellsangle
- the angle, in degrees, that will be the center of the sector-shaped effectspan
- the span, in degrees, of the full arc at the end of the sector-shaped effectcoloring
- a List of Color or subclasses thereof that will replace the default fire/smoke colors herepublic ExplosionEffect(IPackedColorPanel targeting, float duration, squidpony.squidmath.GreasedRegion valid, squidpony.squidmath.Coord center, int radius, double angle, double span, float[] coloring)
angle
(in degrees) and will cover an amount of the circular area (in degrees) equal to span
.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 GreasedRegioncenter
- the center of the explosionradius
- the radius of the explosion, in cellsangle
- the angle, in degrees, that will be the center of the sector-shaped effectspan
- the span, in degrees, of the full arc at the end of the sector-shaped effectcoloring
- an array of colors as packed floats that will replace the default fire/smoke colors hereprotected 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.public PanelEffect.ExplosionEffect useElectricColors()
PanelEffect.GibberishEffect.choices
are selected in a way that
fits that theme.public PanelEffect.ExplosionEffect useFieryColors()
Copyright © Eben Howard 2012–2022. All rights reserved.