Dark Bit Factory & Gravity
GENERAL => Challenges & Competitions => Topic started by: TinDragon on June 11, 2006
-
Here's another one, a real basic starfield as I couldn't think of anything else :)
Graphics 640,480,0,2
SetBuffer BackBuffer()
Dim starx(600)
Dim stary(600)
For lop=0 To 600
starx(lop)=Rnd(640)
stary(lop)=Rnd(480)
Next
Repeat
Cls
For lop=0 To 600
speed=1+(lop Mod 3)
starx(lop)=starx(lop)+speed
If starx(lop)>640 Then starx(lop)=0
Color 85*speed,85*speed,85*speed
Plot starx(lop),stary(lop)
Next
Flip
Until KeyDown(1) Or MouseDown(1)
-
A little unimaginative but Ok.
Btw, you've wasted several lines, I shrunk it for you;
Graphics 640,480,0,2
SetBuffer BackBuffer()
Dim starx(600),stary(600)
For lop=0 To 600
starx(lop)=Rnd(640)
stary(lop)=Rnd(480)
Next
Repeat
Cls
For lop=0 To 600
starx(lop)=starx(lop)+(1+(lop Mod 3))
If starx(lop)>640 Then starx(lop)=0
Color 85*(1+(lop Mod 3)),85*(1+(lop Mod 3)),85*(1+(lop Mod 3))
Plot starx(lop),stary(lop)
Next
Flip
Until KeyDown(1) Or MouseDown(1)
-
Here the BlitzMax Version :)
Graphics 640,480,0
Local starx[601]
Local stary[601]
For lop=0 To 600
starx[lop]=Rnd(640)
stary[lop]=Rnd(480)
Next
Repeat
Cls
For lop=0 To 600
starx[lop]=starx[lop]+(1+(lop Mod 3))
If starx[lop]>640 Then starx[lop]=0
SetColor 85*(1+(lop Mod 3)),85*(1+(lop Mod 3)),85*(1+(lop Mod 3))
Plot starx[lop],stary[lop]
Next
Flip
Until KeyDown(KEY_ESCAPE) Or MouseDown(1)