• Welcome to Dark Bit Factory & Gravity.
 

Short Intro Challenge - Parallax Starfield

Started by TinDragon, June 11, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

TinDragon

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)

Shockwave

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)
Shockwave ^ Codigos
Challenge Trophies Won:

Hotshot

#2
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)