Here is a rocket trail effect:
Rem ***** Main Source File *****
REM SET MAXIMUM DIMS
GLOBAL DIM Particles(10, 200) As entityProperties
REM TYPES
Type entityProperties
num As Integer `sprite - object - light
posX As Float `sprite - object
posY As Float `sprite - object
posZ As Float `sprite - object
vecX As Float `sprite - object - particles
vecY As Float `sprite - object - particles
vecZ As Float `sprite - object - particles
sizeX As Float `object
sizeY As Float `object
sizeZ As Float `object
angX As Float `object
angY As Float `object
angZ As Float `object
fade As Integer `particles
EndType
REM WHITE SMOKE IMAGE
create bitmap 1,50,50
ink rgb(250,200,100),0
for x=1 to 1000
ang=rnd(360)
rad=rnd(20)
dot 25+sin(ang)*rad,25+cos(ang)*rad
next x
blur bitmap 1,4
whiteSmoke = freeImage()
get image whiteSmoke, 0, 0, 50, 50
delete bitmap 1
REM RED SMOKE IMAGE
create bitmap 1,50,50
ink RGB(255,0,0),0
for x=1 to 1000
ang=rnd(360)
rad=rnd(20)
dot 25+sin(ang)*rad,25+cos(ang)*rad
next x
blur bitmap 1,4
redSmoke = freeImage()
get image redSmoke, 0, 0, 50, 50
delete bitmap 1
REM MAKE THE GROUND OBJECT
ground = 1
Make Matrix 1, 1000, 1000, 30, 30
Position Matrix 1, -500, 0, -500
REM MAKE A ROCKET
rocket = freeObject()
Make Object Cylinder rocket, 6
Set Object Smoothing rocket, 100
Position Object rocket, 0, 0, 0
rocketButt = freeObject()
Make Object Sphere rocketButt, 6
Set Object Smoothing rocketButt, 100
Position Object rocketButt, 0, 0, 0
Scale Object rocketButt, 100,10,100
rocketTop = freeObject()
Make Object Cone rocketTop, 6
Set Object Smoothing rocketTop, 100
Position Object rocketTop, 0, 5, 0
Make Mesh From Object 1, rocketTop
Make Mesh From Object 2, rocketButt
Delete Object rocketTop
Delete Object rocketButt
Add Limb rocket, 1, 1
Add Limb rocket, 2, 2
Offset Limb rocket, 1, 0, 6, 0
Offset Limb rocket, 2, 0, -2, 0
xRotate Object rocket, 90
Fix Object Pivot rocket
Rem MAke A WAY POINT TARGET
target = freeObject()
Make Object CUBE target, 1
`HIDE OBJECT target
REM MAIN LOOP
Sync On
DO
REM MOVE CAMERA
ax# = wrapvalue(ax# + mousemovey())
ay# = wrapvalue(ay# + mousemovex())
rotate camera ax#, ay#, 0.0
if mouseclick()=1 then move camera 1
if mouseclick()=2 then move camera -1
` 1 = particle number, (supposed to be)
` 150 = particle amount (200 is max value)
` -50, 2, -50 = the coordinates where particles will spawn
`particleCounter1 = a place holder for the particle number ID function should return the same value in and out
`white smoke = is the image number you should apply
x# = object position x(rocket)
y# = object position y(rocket)
z# = object position z(rocket)
particle1Counter = makeParticles(1, 150, x#, y#, z#, particle1Counter, whiteSmoke)
`particle2Counter = makeParticles(2, 50, -50, 2, 50, particle2Counter, whiteSmoke)
`particle3Counter = makeParticles(3, 150, 50, 2, -50, particle3Counter, redSmoke)
`particle4Counter = makeParticles(4, 50, 50, 2, 50, particle4Counter, redSmoke)
oldangx# = object angle x(rocket)
oldangy# = object angle y(rocket)
oldangz# = object angle z(rocket)
point object rocket, object position x(target),object position y(target),object position z(target)
tarangx# = object angle x(rocket)
tarangy# = object angle y(rocket)
tarangz# = object angle z(rocket)
rotate object rocket, oldangx#,oldangy#,oldangz#
move object rocket, 0.5
smooth = 10
ROTATE OBJECT rocket, curveangle(tarangx#,oldangx#,smooth),curveangle(tarangy#,oldangy#,smooth),curveangle(tarangz#,oldangz#,smooth)
`yrotate object fish, wrapvalue(object angle y(fish)+.1)
if object collision(rocket,target)>0
position object target,rnd(100)+20,rnd(100)+20,rnd(100)+20
endif
REM INFO
set cursor 0, 0
print "FPS: ",screen fps()
print "PRESS SPACE TO TOGGLE GROUND OBJECT GHOST ON/OFF"
print "USE MOUSE TO MOVE AROUND"
Sync
Loop
Function makeParticles(num, amount, x, y, z, particleCounter, image)
If particles(num, 0).num = 0
obj = freeObject()
For f = obj To obj+Amount
i = f-obj
particles(num, i).num = f
particles(num, i).posX = x
particles(num, i).posY = y
particles(num, i).posZ = z
particles(num, i).sizeX = 10.0
particles(num, i).sizeY = 10.0
particles(num, i).sizeZ = 10.0
particles(num, i).angX = 0.0
particles(num, i).angY = 0.0
particles(num, i).angZ = 0.0
Make Object Plain f, particles(num, i).sizeX, particles(num, i).sizeY
Texture Object f, image
Hide Object f
Set Object Fog f, 0
Ghost Object On f, 0
Disable Object Zwrite f
Next f
EndIf
For f = 0 To Amount
particles(num, f).sizeX = particles(num, f).sizeX + 2.0
particles(num, f).sizeY = particles(num, f).sizeY + 2.0
particles(num, f).posX = particles(num, f).posX + particles(num, f).vecX + windx#
particles(num, f).posY = particles(num, f).posY + particles(num, f).vecY
particles(num, f).posZ = particles(num, f).posZ + particles(num, f).vecZ + windx#
`Fade particle value
particles(num, f).fade = particles(num, f).fade - (200 / amount * 2)
`Position, scale and fade particle object
Position Object particles(num, f).num, particles(num, f).posX, particles(num, f).posY, particles(num, f).posZ
Scale Object particles(num, f).num, particles(num, f).sizeX, particles(num, f).sizeY, 100
Fade Object particles(num, f).num, particles(num, f).fade
`Point at camera
Set Object To Camera Orientation particles(num, f).num
Next f
Inc particleCounter
If particleCounter > amount Then particleCounter = 1
If particles(num, particleCounter).Fade < 0
`Position
particles(num, particleCounter).posX = x
particles(num, particleCounter).posY = y
particles(num, particleCounter).posZ = z
`Scale
particles(num, particleCounter).sizeX = 25
particles(num, particleCounter).sizeY = 25
`Velocity (randomize)
particles(num, particleCounter).vecX = Rnd(100) / 500.0 - 0.1
particles(num, particleCounter).vecY = Rnd(200) / 500.0 + 0.1
particles(num, particleCounter).vecZ = Rnd(100) / 500.0 - 0.1
particles(num, particleCounter).fade = 200 `ttlPrc / 2.0
`Show the particle
Show Object particles(num, particleCounter).num
EndIf
EndFunction particleCounter
Function freeObject()
Repeat
Inc i
Until Object Exist(i) = 0
EndFunction i
Function freeImage()
Repeat
Inc i
Until Image Exist(i) = 0
EndFunction i
Too Sexy