08-30-2023, 08:24 PM
star travel by pW
Code: (Select All)
'star travel copyright by (c)Peter Wirbelauer in o2
'you don't have permission to re-distribute code
'micro(A) version by Aurel (c)AurelSoft
var i,s_x,s_y ,anz, speed, xScreen,yScreen ,run
anz=300, speed=3, xScreen=800, yScreen=600
var stern_x[1000]
var stern_y[1000]
var stern_z[1000]
func StarInit()
i=1
while i < anz
stern_x[i] = -400 * Rand(xscreen/8)
stern_y[i] = -300 * Rand(yscreen/8)
stern_z[i] = Rand(155)
i=i+1
wend
Endfn
Func StarUpdate()
i=1
while i < anz
stern_z[i] = stern_z[i] - speed
if stern_z[i] < speed : stern_z[i] = 255 : endif
s_x = (stern_x[i] / stern_z[i]) + (xscreen)
s_y = (stern_y[i] / stern_z[i]) + (yscreen )
'color =255 - stern_z(i)
fcolor 120 , 180 ,250
rect s_x, s_y, 2, 2:
i=i+1
wend
EndFn
StarInit()
run=1
While run=1
rect 0,0,800,600
'anz = rand(500)
StarUpdate()
swap
Wend
micro(A)developer
http://basic4us.epizy.com/forum/index.php
http://basic4us.epizy.com/forum/index.php