Dark Bit Factory & Gravity

PROGRAMMING => Other languages => Yabasic => Topic started by: rain_storm on July 23, 2008

Title: 256b StarFeild
Post by: rain_storm on July 23, 2008
Hasnt been much activity on this board in awhile so I thought it was time to do something about that. This is a play on the minimum lines of source code theme that has been done before. This time the aim was to get a demo effect happening in no more than 256 bytes of source code. To start with I only did a simple paralax starfeild. The stars are coloured based on their distance. Tricks that have been used include -
tricks that couldnt be used this time -

well here is the source code unrolled for readability the attached file is crammed onto fewer lines to fit into the 256 byte limit
Code: [Select]
#R_S
Open Window 1,1:
s=511:
Dim x(s),y(s),z(s):
For a=0 To s:
x(a)=Ran(s):
y(a)=Ran(s):
z(a)=Ran(3)+1:
Next
0 setdispbuf d:
d=1-d:
setDrawBuf d:
Clear Window:
For a=0 To s:
x(a)=And(x(a)+z(a),s):
c=64*z(a):
SetRGB 1,c,c,c:
Fill Circle x(a)*1.3,y(a),z(a):
Next:
Goto 0