Class ParticleSpawnerOption
java.lang.Object
rekit.logic.gameelements.particles.ParticleSpawnerOption
Represents an option for a ProgressDependency. A ProgressDependency
requires a start and an end value. With the ParticleSpawnerOption these can
be randomly generated multiple times. Given a minimum and a maximum value for
each start and delta (startMin, startMax, deltaMin, deltaMax) the method
randomizeProgressDependency() will return the ProgressDependency with random
start and end values accordingly. Note: the delta value will be added
to the start value to calculate the end value. So if variation in negative
direction is desired you must supply a negative delta.
- Author:
- Angelo Aracri
-
Constructor Summary
ConstructorsConstructorDescriptionParticleSpawnerOption
(float value) Short-hand constructor that takes argument value and uses it as the start value and sets delta to 0 for no randomized variation and no change of the ProgressDependencies value.ParticleSpawnerOption
(float start, float delta) Short-hand constructor that takes arguments start and delta values for no randomized variation.ParticleSpawnerOption
(float startMin, float startMax, float deltaMin, float deltaMax) Constructor that takes arguments for lower and upper start and delta values for full randomized variation. -
Method Summary
-
Constructor Details
-
ParticleSpawnerOption
public ParticleSpawnerOption(float startMin, float startMax, float deltaMin, float deltaMax) Constructor that takes arguments for lower and upper start and delta values for full randomized variation.- Parameters:
startMin
- the minimal value for the ProgressDependencies start valuestartMax
- the maximum value for the ProgressDependencies start valuedeltaMin
- the minimal value for delta that will be used for the ProgressDependencies end valuedeltaMax
- the maximal value for delta that will be used for the ProgressDependencies end value
-
ParticleSpawnerOption
public ParticleSpawnerOption(float start, float delta) Short-hand constructor that takes arguments start and delta values for no randomized variation.- Parameters:
start
- the value for the ProgressDependencies start valuedelta
- the value for delta that will be used for the ProgressDependencies end value
-
ParticleSpawnerOption
public ParticleSpawnerOption(float value) Short-hand constructor that takes argument value and uses it as the start value and sets delta to 0 for no randomized variation and no change of the ProgressDependencies value.- Parameters:
value
- the value for the ProgressDependencies start value
-
-
Method Details
-
randomize
Returns a randomized ProgressDependency with start and end values randomly generated according to specified options (startMin, startMax, deltaMin, deltaMax).- Returns:
- the randomized ProgressDependency
-