Its the weird part as it dosent work here ???
// Particles_Setup (IMG , xDir , yDir , Life , Size , Ang , Rate , X , Y )
Player.Engine = Particles_Setup ( Player.Engine , img_Particle , -50 , 0 , 0.3 , 16 , 80 , 60 , GetSpriteX ( Player.ID ) , GetSpriteY ( Player.ID )+ (GetSpriteHeight( Player.ID )/2) )
And inside my particle function...
function Particles_Setup ( id as integer , IMG as integer , xDir as integer , yDir as integer , Life as float, Size as integer , Ang as integer , Rate as integer , X as float , Y as float)
// If particles exist destroy them before creating new ones
if GetParticlesExists ( id ) = 1
DeleteParticles ( id )
endif
id = CreateParticles ( X , Y )
SetParticlesImage ( id , IMG )
SetParticlesStartZone ( id , 0, 0, 0, 0 )
SetParticlesDirection ( id , xDir , yDir )
SetParticlesLife ( id , Life )
SetParticlesSize ( id , Size )
SetParticlesAngle ( id , Ang )
SetParticlesFrequency ( id , Rate )
endfunction id
Iam a bit confused?
_______________________________________________________________________
I think i found an bug?
As this one work!
Particle.ID = Player.Engine
Player.Engine = Particles_Setup ( img_Particle , -50 , 0 , 0.3 , 16 , 80 , 60 , GetSpriteX ( Player.ID ) , GetSpriteY ( Player.ID )+ (GetSpriteHeight( Player.ID )/2) )
function Particles_Setup ( IMG as integer , xDir as integer , yDir as integer , Life as float, Size as integer , Ang as integer , Rate as integer , X as float , Y as float)
// If particles exist destroy them before creating new ones
if GetParticlesExists ( Particle.ID ) = 1
DeleteParticles ( Particle.ID )
endif
Particle.ID = CreateParticles ( X , Y )
SetParticlesImage ( Particle.ID , IMG )
SetParticlesStartZone ( Particle.ID , 0, 0, 0, 0 )
SetParticlesDirection ( Particle.ID , xDir , yDir )
SetParticlesLife ( Particle.ID , Life )
SetParticlesSize ( Particle.ID , Size )
SetParticlesAngle ( Particle.ID , Ang )
SetParticlesFrequency ( Particle.ID , Rate )
endfunction Particle.ID
But if i pass any variabel to the global type Particle.ID
inside the function so does it get screwed up?