jjPARTICLE class JJ2+
A simple visual effect in the level
Particles are lightweight effects such as sparks, smoke, debris, weather or floating score text. They don't interact with objects or players and disappear on their own after a while. Up to 1024 particles exist at once, all listed in jjParticles. Create new ones with jjAddParticle(). Each type keeps its own extra properties in the member of the same name, for example jjPARTICLE::fire for PARTICLE::FIRE.
Properties
- jjPARTICLEFIRE fire
- Properties of a PARTICLE::FIRE particle
- jjPARTICLEFLOWER flower
- Properties of a PARTICLE::FLOWER particle
- jjPARTICLEICETRAIL icetrail
- Properties of a PARTICLE::ICETRAIL particle
- bool isActive
- Whether the particle is in use
- jjPARTICLELEAF leaf
- Properties of a PARTICLE::LEAF particle
- jjPARTICLEPIXEL pixel
- Properties of a PARTICLE::PIXEL particle
- jjPARTICLERAIN rain
- Properties of a PARTICLE::RAIN particle
- jjPARTICLESMOKE smoke
- Properties of a PARTICLE::SMOKE particle
- jjPARTICLESNOW snow
- Properties of a PARTICLE::SNOW particle
- jjPARTICLESPARK spark
- Properties of a PARTICLE::SPARK particle
- jjPARTICLESTAR star
- Properties of a PARTICLE::STAR particle
- jjPARTICLESTRING string
- Properties of a PARTICLE::STRING particle
- uint8 type
- Type of the particle
- float xPos C++
- Horizontal position in pixels
- float xSpeed C++
- Horizontal speed in pixels per tick
- float yPos C++
- Vertical position in pixels
- float ySpeed C++
- Vertical speed in pixels per tick
Property documentation
jjPARTICLEFIRE jjPARTICLE:: fire
Properties of a PARTICLE::FIRE particle
A small flame that slowly falls while its color changes now and then, until the color reaches colorStop.
jjPARTICLEFLOWER jjPARTICLE:: flower
Properties of a PARTICLE::FLOWER particle
A translucent flower of one color that drifts and shrinks until it vanishes. It stops moving inside walls.
jjPARTICLEICETRAIL jjPARTICLE:: icetrail
Properties of a PARTICLE::ICETRAIL particle
A tiny dot that falls while its color changes now and then, until the color reaches colorStop.
bool jjPARTICLE:: isActive
Whether the particle is in use
Set when a particle is created and cleared when it disappears. Checking jjPARTICLE::type against PARTICLE::INACTIVE is the more common way to tell.
jjPARTICLELEAF jjPARTICLE:: leaf
Properties of a PARTICLE::LEAF particle
A leaf sprite that drifts by its speed with a random jiggle down and to the left, then lies on the ground for a while. It disappears outside of the view.
jjPARTICLEPIXEL jjPARTICLE:: pixel
Properties of a PARTICLE::PIXEL particle
A small square of debris that falls, slows down and bounces off the ground, like the pieces of a destroyed enemy.
jjPARTICLERAIN jjPARTICLE:: rain
Properties of a PARTICLE::RAIN particle
A raindrop sprite that falls by its speed, 6 pixels per tick by default, and disappears after a while. A drop of the weather splashes where it hits the ground instead and disappears outside of the view.
jjPARTICLESMOKE jjPARTICLE:: smoke
Properties of a PARTICLE::SMOKE particle
A small gray puff that wobbles upward and disappears after a while.
jjPARTICLESNOW jjPARTICLE:: snow
Properties of a PARTICLE::SNOW particle
A snowflake sprite that moves by its speed until its lifetime runs out. A new snow particle has no frameBase, so set one or it disappears right away. A snowflake of the weather sways and speeds up downwards instead, melts where it hits the ground and disappears outside of the view.
jjPARTICLESPARK jjPARTICLE:: spark
Properties of a PARTICLE::SPARK particle
A tiny dot that falls while its color changes quickly, until the color reaches colorStop.
jjPARTICLESTAR jjPARTICLE:: star
Properties of a PARTICLE::STAR particle
A star that falls slowly and shrinks until it disappears, like those shown during a sugar rush.
jjPARTICLESTRING jjPARTICLE:: string
Properties of a PARTICLE::STRING particle
A short text, such as the points gained for destroying something, that moves faster and faster and disappears after a moment.
uint8 jjPARTICLE:: type
Type of the particle
One of the PARTICLE::Type constants, PARTICLE::INACTIVE for a free slot. Decides which of the type-specific members applies.