About a week ago i spotted some code which produced smoke trails. Instead of just doing a cut and paste job i though i would try and recreate it the Maelstrom way (aka the most inefficient way). I didn't think i did to badly but i have got some stange results.
When the program runs a cube heads off down the matrix with a basic smoke trail behind it. However, after a while the smoke trail develops some odd gaps. I've spent ages trying to fix it but i've got brain lock. Please, could someone tell me where i've gone wrong!!
here is the smoke bmp if you need it.
http://maelstromhome.mysite.freeserve.com/pics/smoke3.bmp
autocam off
hide mouse
sync on
sync rate 60
smoke=1
land=2
mis=3
make matrix land,1000,1000,10,10
position matrix land, 0,0,0
position camera 10,30,10
make object cube mis,5
position object mis,10,10,40
type smokeframe
smokeobj as integer
x# as float
y# as float
z# as float
fade# as float
size# as float
endtype
dim smoketrail(100) as smokeframe
color backdrop rgb(100,100,255)
load image "smoke3.bmp",smoke
for a=1 to 100
smoketrail(a).smokeobj=a+100
make object plain smoketrail(a).smokeobj,15,15
texture object smoketrail(a).smokeobj,1
set object transparency smoketrail(a).smokeobj,1
ghost object on smoketrail(a).smokeobj,0
smoketrail(a).fade#=100
smoketrail(a).size#=15
ss=int(rnd(360))
rotate object smoketrail(a).smokeobj,0,0,ss
next a
a=0
color backdrop rgb(0,0,0)
rem **********************************************************
while spacekey()=0
if a=100 then a=0
cnt=cnt+1
if cnt=3 then a=a+1
move object mis,3
x#=object position x(mis)
y#=object position y(mis)
z#=object position z(mis)
if cnt=3
cnt=0
position object smoketrail(a).smokeobj,x#,y#,z#
for s=1 to a
if smoketrail(s).fade#=0 then smoketrail(s).fade#=100
rem if smoketrail(s).size#=115 then smoketrail(s).size#=15
rem dec smoketrail(s).fade#,0.5
rem inc smoketrail(s).size#,1
smoketrail(s).fade#=smoketrail(s).fade#-1
rem smoketrail(s).size#=smoketrail(s).size#+1
rem scale object smoketrail(s).smokeobj,100+(smoketrail(s).size#*4),100+(smoketrail(s).size#*4),0
fade object smoketrail(s).smokeobj,smoketrail(s).fade#
next s
endif
gosub _playermove:
sync
endwhile
rem ****************************************************************************
_playermove:
rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
camx#=camera angle x(0)
camy#=camera angle y(0)
if upkey()=1 then xrotate camera 0,0 : move camera 0,2: xrotate camera 0,camx#
if leftkey()=1 then yrotate camera 0,camy#-90:move camera 0,2: yrotate camera 0,camy#
if rightkey()=1 then yrotate camera 0,camy#+90:move camera 0,2:yrotate camera 0,camy#
if downkey()=1 then xrotate camera 0,0 : move camera 0,-2: xrotate camera 0,camx#
if wrapvalue(camera angle x(0))>40 and wrapvalue(camera angle x(0))<180 then xrotate camera 0,40
if wrapvalue(camera angle x(0))>180 and wrapvalue(camera angle x(0))<280 then xrotate camera 0,280
playerheight#=get ground height(land,camera position x(),camera position z())
position camera camera position x(0),playerheight#+10,camera position z()
return