Hi all,
I made a code like firework.
The first explotions looks good.
After around 10 seconds the fireworks explotion begin to fall faster and faster.
Anyone an idea what is going wrong?
Should I delete the particles and then rebuild it in the main loop?
Here is the code.
// Project: fireworks
// Created: 2014-12-14
// set window properties
SetWindowTitle( "fireworks" )
SetWindowSize( 480, 640, 0 )
// set display properties
SetVirtualResolution( 480, 640 )
SetDisplayAspect(0.66)
SetOrientationAllowed( 1, 0, 0, 0 )
SetVSync(1)
fire=0
CreateParticles(1,-100,-100)
SetParticlesSize(1,4)
SetParticlesLife(1,1)
SetParticlesMax(1,1)
`SetParticlesActive(1,0)
do
Print( Timer())
if (fire=0)
rem and GetPointerPressed()=1
SetParticlesPosition(1,Random(10,470),Random(50,200))
ResetParticleCount(1)
SetParticlesSize(1,2)
SetParticlesLife(1,Random(2,4))
SetParticlesMax(1,Random(30,50))
SetParticlesFrequency(1,1000)
SetParticlesVelocityRange(1,1,2)
SetParticlesColorInterpolation(1,100)
AddParticlesColorKeyFrame(1,1,Random(100,250),Random(100,250),Random(100,250),255)
AddParticlesColorKeyFrame(1,2,Random(100,200),Random(100,200),Random(100,200),200)
AddParticlesColorKeyFrame(1,4,Random(50,100),Random(50,100),Random(50,100),25)
AddParticlesForce(1,1,4,0,15)
ResetTimer()
fire=1
endif
if GetParticlesMaxReached(1)=1
fire=0
endif
Print( ScreenFPS() )
Sync()
loop
Greetings,
Jo