Game Development Reference
In-Depth Information
Particle Candy emitter running the attractor sample
Note Chapter 14 will discuss a related tool, Particle Designer, which can be used to visually create
particle effects and export the settings to Particle Candy.
Sample Code
Particles.CreateEmitter("E1", screenW*0.05, screenH*0.5, 45, true, true)
-- DEFINE A PARTICLE TYPE
Particles.CreateParticleType ("Test",
{
imagePath = "arrow.png",
imageWidth = 32, -- PARTICLE IMAGE WIDTH (newImageRect)
imageHeight = 32, -- PARTICLE IMAGE HEIGHT (newImageRect)
velocityStart = 150, -- PIXELS PER SECOND
alphaStart = 0, -- PARTICLE START ALPHA
fadeInSpeed = 2.0, -- PER SECOND
fadeOutSpeed = −1.0, -- PER SECOND
fadeOutDelay = 3000, -- WHEN TO START FADE-OUT
scaleStart = 1.0, -- PARTICLE START SIZE
weight = 0, -- PARTICLE WEIGHT (>0 FALLS DOWN, <0 WILL RISE UPWARDS)
bounceX = false, -- REBOUND FROM SCREEN LEFT & RIGHT BORDER
bounceY = false, -- REBOUND FROM SCREEN TOP & BOTTOM BORDER
bounciness = 0.75, -- REBOUND ENERGY
emissionShape = 0, -- 0 = POINT, 1 = LINE, 2 = RING, 3 = DISC
emissionRadius= 140, -- SIZE / RADIUS OF EMISSION SHAPE
killOutsideScreen = true, -- PARENT LAYER MUST NOT BE NESTED OR ROTATED!
lifeTime = 4000, -- MAX. LIFETIME OF A PARTICLE
 
Search WWH ::




Custom Search