using a snow effect code I found posted on the dark basic forums
im trying to get some snow weather effects in the game im working on. most went successfully except I dont want the snow particals to follow the players exact movement. I want them to fall down straight until the go out of a certain radius range of the player
then have the Z position of that partical to be moved back in range of the player.
heres some code ended up with so far but im still playing with the code
note: object 3 is player object
SnowAmount=500
SnowSpeed# = 0.3
global dim rr#(1000+SnowAmount)
//rem make snow particles
for a=1000 to 1000+SnowAmount
rr#(a) = rnd(300) // to add some Z depth to snow fall
snow_particle_init(a,rr#)
texture object a,1001
set object transparency a,2
position object a,OBJECT POSITION X(3),object position y(3)+ rnd(300),OBJECT POSITION Z(3)
rotate object a,wrapvalue(object angle x(a)+rnd(360)),object angle y(a),wrapvalue(object angle z(a)+rnd(360))
next a
DO
// if snowing then make snow fall
for a=1000 to 1000+SnowAmount
snow_particle(a,rr#)
next a
LOOP
// snow generating functions
function snow_particle_init(a,rr#)
make object plane a,1,1
set object a,1,0,0,1
color object a,rgb(255,255,255)
endfunction
// updates the snow particals
function snow_particle(a,rr#)
height# = object position y(a) - SnowSpeed#
if height# < OBJECT POSITION Y(3) - 5
rr#(a)= rnd(300)
height# = OBJECT POSITION Y(3) + 100
endif
position object a,OBJECT POSITION X(3)+(sin(a)*rr#(a)),height#,OBJECT POSITION Z(3)+(cos(a)*rr#(a))
rotate object a,object angle x(a),object angle y(a),wrapvalue(object angle z(a)+1)
endfunction