Hi! I wrote this code to try and implement a blur effect. I have not added any blur effect yet, I just want some tips on how I could achieve it.
The code below is just some stupid code that makes a starfield. Basically and hints or tips only that will point me in the right direction for making each star have a blur effect. ie leaving a blurry trail behind it as it goes down the screen
Graphics3d 1024,768,16
SetBuffer BackBuffer()
Type particle
Field x#
Field y#
Field g#
Field s#
End Type
Global maxstars = 0
Global numstars = 10
While Not KeyHit(1)
Cls
make_stars()
plot_stars()
increase_stars()
Text 0,750,"Number of stars =" +numstars
Text 0,740,"Maximum Stars on screen =" +maxstars
Text 0,10,"Press Left Control key to increase stars"
Flip
Wend
End
Function make_stars()
For i = maxstars To numstars
p.particle = New particle
maxstars = maxstars + 1
p\y = -1
p\x = Rnd(0,1024)
p\s = Rnd(1,10)
Next
End Function
Function plot_stars()
For p.particle = Each particle
Plot p\x,p\y
p\y = p\y + p\s
If p\y > 768 Then
Delete p
maxstars = maxstars - 1
EndIf
Next
End Function
Function increase_stars()
If KeyDown(29) = True
numstars = numstars + 1
EndIf
End Function
Should I start by looking at locking buffers?
|