Sprite trails

Blitz3D Forums/Blitz3D Beginners Area/Sprite trails

Answer to 1st question:

type SpriteTrail

field x
field y
field lifetime
field r
field g
field b

end type

in your code where you place the pixels do the following instead:
Trail.SpriteTrail=new SpriteTrail
Trail\x=your trailing pixel's x position
Trail\y=your trailing pixel's y position
Trail\r=amount of red
trail\g=amount of green
trail\b=amount of blue
trail\lifetime=number of frames you want this point in the trail to exist for

then in your main loop where you would normally draw the pixels
do the following:

For Trail.spritetrail=each spritetrail
trail\lifetime=trail\lifetime-1
if trail\lifetime>0 then
color trail\r,trail\g,trail\b
plot trail\x,trail\y
else
delete trail
endif
next


Answer to 2nd question:

Explain a little further what you are hoping to achieve please.