Advertisement
ForrestFox

Starfeld

Feb 17th, 2021 (edited)
195
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SCREEN 13
  2.  
  3. TYPE point3d
  4.   x AS INTEGER
  5.   y AS INTEGER
  6.   z AS INTEGER
  7.   c AS INTEGER
  8.   v AS SINGLE
  9. END TYPE
  10.  
  11. DIM star(0 TO 255) AS point3d
  12.  
  13. FOR i = 0 TO 255
  14.  
  15.   star(i).x = RND * 256 - 128
  16.   star(i).y = RND * 256 - 128
  17.   star(i).z = RND * 128 + 16
  18.   star(i).c = RND * 15 + 16
  19.   star(i).v = INT(RND * 2) + 1
  20.  
  21. NEXT
  22.  
  23. ppd = 100
  24.  
  25. DO
  26.  
  27.   FOR i = 0 TO 255
  28.  
  29.     z = star(i).z
  30.     x = INT(160 + ppd * star(i).x / z)
  31.     y = INT(100 - ppd * star(i).y / z)
  32.     PSET (x, y), 0
  33.  
  34.     z = z - star(i).v
  35.     IF z < 16 THEN z = z + 128
  36.     star(i).z = z
  37.  
  38.     x = INT(160 + ppd * star(i).x / z)
  39.     y = INT(100 - ppd * star(i).y / z)
  40.     PSET (x, y), star(i).c
  41.  
  42.   NEXT
  43.  
  44. LOOP WHILE INKEY$ = ""
Advertisement
RAW Paste Data Copied
Advertisement