ok, thanks for the code works well, i only got to see it just know, yesterday i had a go at making my own code but it did not go well here is the code:
Type particle
Field entity
Field x#,y#,z#
Field time
Field timer
Field alive
Field speed#
End Type
Global spr
Graphics3D 1280,1024,32,1
SetBuffer BackBuffer()
cam=CreateCamera()
PositionEntity cam,0,0,-10
For t=1 To 10
spr=CreateSprite()
Next
While Not KeyHit(1)
createpart( Rand(1,2), 0, Rand(1,2), 1, .1)
Update
RenderWorld
Flip
Wend
End
Function createpart( X#, Y#, Z#, Alive, Speed#)
p.particle = New particle
p\entity = spr
p\x# = x#
p\y# = y#
p\z# = z#
PositionEntity p\entity, p\x#, p\y#, p\z#
p\alive = alive
p\speed# = speed#
p\time=1000
p\timer = MilliSecs()
End Function
Function update()
For p.particle = Each particle
MoveEntity p\entity, 0, 0+p\speed, 0
If MilliSecs()>p\time+p\timer Then
p\alive=0
PositionEntity p\entity,p\x#,p\y-p\y-p\y,p\z
EndIf
Next
End Function
i dunno what i have done wring in it apart from almost all of it.
Type particle
Field entity
Field x#,y#,z#
Field time
Field timer
Field alive
Field speed#
End Type
Global spr
Graphics3D 1280,1024,32,1
SetBuffer BackBuffer()
cam=CreateCamera()
PositionEntity cam,0,0,-10
For t=1 To 10
spr=CreateSprite()
Next
While Not KeyHit(1)
createpart( Rand(1,2), 0, Rand(1,2), 1, .1)
Update
RenderWorld
Flip
Wend
End
Function createpart( X#, Y#, Z#, Alive, Speed#)
p.particle = New particle
p\entity = spr
p\x# = x#
p\y# = y#
p\z# = z#
PositionEntity p\entity, p\x#, p\y#, p\z#
p\alive = alive
p\speed# = speed#
p\time=1000
p\timer = MilliSecs()
End Function
Function update()
For p.particle = Each particle
MoveEntity p\entity, 0, 0+p\speed, 0
If MilliSecs()>p\time+p\timer Then
p\alive=0
PositionEntity p\entity,p\x#,p\y-p\y-p\y,p\z
EndIf
Next
End Function
i dunno what i have done wring in it apart from almost all of it.