Hi,
Some funny stars.
screen(640,480,0,"3D Stars")
backcolor(0,0,0)
setframetimer(60)
function Rand(minZahl,maxZahl)
maxZahl= (maxZahl-minZahl)
return int(rnd()*maxZahl+minZahl)
end
sx,sy,m,col,anz,speed,xscreen,yscreen = 0,0,0,0,5000,2,640,480
stern_x ={}
stern_y ={}
stern_z ={}
for m=1,anz do
stern_x[m]=0
stern_y[m]=0
stern_z[m]=0
end
function starinit()
for m=1,anz do
stern_x[m]= Rand(-(xscreen/2),(xscreen/2)) *128
stern_y[m]= Rand(-(yscreen/2),(yscreen/2)) *128
stern_z[m]= Rand(speed,255)
end
end
starinit()
repeat
k=getkey()
alphachannel(75)
cls()
for m=1,anz do
stern_z[m] = stern_z[m] - speed
if stern_z[m] <= speed then
stern_z[m] = 255
end
sx = (stern_x[m] / stern_z[m]) + (xscreen /2)
sy = (stern_y[m] / stern_z[m]) + (yscreen /2)
color(255,255,255)
fillcircle(sx,sy,2)
end
redraw()
until k==27
closewindow()