sorry for the Comic thread title a lot to me no better man one;)
I have a Particlesystem in which I can specify the start and endSprite for the lifetime will then change the sprite.
Now I would like that when I set a flag loop = True, he when he starts at the end reached is at 0.
Kp like best? Greetings and thank you for your suggestions.
A demo, or broken code I have now not I would have to create.
Code: Select all
Prozedur ADD_PARTICLE2(*ParticleTemplate.Particle .....)
Protected.f fInvLifeTime = 1.0 / fLifeTime
AddElement(Particle())
With Particle()
;// Start und Endsprite bestimmen
\Particle = *ParticleTemplate\StartParticle
\DeltaParticle = (*ParticleTemplate\EndParticle - *ParticleTemplate\StartParticle) * fInvLifeTime
;...... Rest
endwith()
endprozedur()
procedure MOVE_PARTICLE(fTime.f)
;// Partikel animieren
\Particle + \DeltaParticle * fTime.f
endprozedur
Procedure RENDER_PARTICLE(fTime.f)
DisplaySprite()
Endprozedur
Code: Select all
;// Partikel animieren
\Particle + \DeltaParticle * fTime.f
; If \Particleloop
;/ Last Particlesprite ? set new startparticle
; If \Particle = \EndParticle
; \Particle = \StartParticle
; Debug "reset"
; EndIf
; EndIf