Author Topic: Starfield 2020  (Read 1518 times)

0 Members and 1 Guest are viewing this topic.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Starfield 2020
« on: June 15, 2020, 12:50:09 am »
Some of you might remember that last year we had fun making some of our own star fields. So I decided tonight to make another one, this time using the same math as b+ gave me when I needed help fixing my walls on my circular maze generator. You all will probably wonder why I made so many variables when most likely I probably didn't need to. But it's the easiest way I knew how. Each star with its own set of variables and loops. They each have their own fill-in loop because many of them are different sizes. To control the speed, use the mouse wheel. It can go from Warp .2 to Warp 10. I used the _LIMIT command to calculate the speed. Enjoy.

Code: QB64: [Select]
  1. 'Starfield 2020 - by Sierraken
  2. 'Made on June 14, 2020.
  3. 'Use your mouse wheel to control speed. Esc to quit.
  4. 'Thanks to b+ for some of the math.
  5.  
  6. SCREEN _NEWIMAGE(800, 600, 32)
  7. x = 400: y = 300
  8.  
  9. 'Speed
  10. sz = 50
  11. sz2 = 50
  12. sz3 = 50
  13. sz4 = 50
  14. sz5 = 50
  15. sz6 = 50
  16. sz7 = 50
  17. sz8 = 50
  18. sz9 = 50
  19. sz10 = 50
  20. sz11 = 50
  21. sz12 = 50
  22. sz13 = 50
  23. sz14 = 50
  24. sz15 = 50
  25. sz16 = 50
  26.  
  27. ra = _PI(2) * RND
  28. ra2 = _PI(2) * RND
  29. ra3 = _PI(2) * RND
  30. ra4 = _PI(2) * RND
  31. ra5 = _PI(2) * RND
  32. ra6 = _PI(2) * RND
  33. ra7 = _PI(2) * RND
  34. ra8 = _PI(2) * RND
  35. ra9 = _PI(2) * RND
  36. ra10 = _PI(2) * RND
  37. ra11 = _PI(2) * RND
  38. ra12 = _PI(2) * RND
  39. ra13 = _PI(2) * RND
  40. ra14 = _PI(2) * RND
  41. ra15 = _PI(2) * RND
  42. ra16 = _PI(2) * RND
  43.  
  44. 'Size
  45. s = 1
  46. s2 = 1
  47. s3 = 1.25
  48. s4 = 1.25
  49. s5 = 1.25
  50. s6 = 1.25
  51. s7 = 1.5
  52. s8 = 1.5
  53. s9 = 1.5
  54. s10 = 1.75
  55. s11 = 1.75
  56. s12 = 2
  57. s13 = 2.25
  58. s14 = 2.5
  59. s15 = 2.75
  60. s16 = 3
  61.  
  62. l = 200
  63.     _LIMIT l
  64.     mouseWheel = 0
  65.         mouseWheel = mouseWheel + _MOUSEWHEEL
  66.         IF mouseWheel > 0 THEN l = l - 2
  67.         IF mouseWheel < 0 THEN l = l + 2
  68.     LOOP
  69.     IF l < 20 THEN l = 20
  70.     IF l > 1000 THEN l = 1000
  71.     w = l / 100
  72.     w$ = STR$(w)
  73.     _TITLE "Warp: " + w$ + "       Use your Mouse Wheel to control speed. Esc to quit."
  74.     FOR sze = .25 TO s STEP .25
  75.         CIRCLE (x + (sz) * COS(ra), y + (sz) * SIN(ra)), sze, _RGB32(255, 255, 255)
  76.     NEXT
  77.     FOR sze = .25 TO s2 STEP .25
  78.         CIRCLE (x + (sz2) * COS(ra2), y + (sz2) * SIN(ra2)), sze, _RGB32(255, 255, 255)
  79.     NEXT
  80.     FOR sze = .25 TO s3 STEP .25
  81.         CIRCLE (x + (sz3) * COS(ra3), y + (sz3) * SIN(ra3)), sze, _RGB32(255, 255, 255)
  82.     NEXT
  83.     FOR sze = .25 TO s4 STEP .25
  84.         CIRCLE (x + (sz4) * COS(ra4), y + (sz4) * SIN(ra4)), sze, _RGB32(255, 255, 255)
  85.     NEXT
  86.     FOR sze = .25 TO s5 STEP .25
  87.         CIRCLE (x + (sz5) * COS(ra5), y + (sz5) * SIN(ra5)), sze, _RGB32(255, 255, 255)
  88.     NEXT
  89.     FOR sze = .25 TO s6 STEP .25
  90.         CIRCLE (x + (sz6) * COS(ra6), y + (sz6) * SIN(ra6)), sze, _RGB32(255, 255, 255)
  91.     NEXT
  92.     FOR sze = .25 TO s7 STEP .25
  93.         CIRCLE (x + (sz7) * COS(ra7), y + (sz7) * SIN(ra7)), sze, _RGB32(255, 255, 255)
  94.     NEXT
  95.     FOR sze = .25 TO s8 STEP .25
  96.         CIRCLE (x + (sz8) * COS(ra8), y + (sz8) * SIN(ra8)), sze, _RGB32(255, 255, 255)
  97.     NEXT
  98.     FOR sze = .25 TO s9 STEP .25
  99.         CIRCLE (x + (sz9) * COS(ra9), y + (sz9) * SIN(ra9)), sze, _RGB32(255, 255, 255)
  100.     NEXT
  101.     FOR sze = .25 TO s10 STEP .25
  102.         CIRCLE (x + (sz10) * COS(ra10), y + (sz10) * SIN(ra10)), sze, _RGB32(255, 255, 255)
  103.     NEXT
  104.     FOR sze = .25 TO s11 STEP .25
  105.         CIRCLE (x + (sz11) * COS(ra11), y + (sz11) * SIN(ra11)), sze, _RGB32(255, 255, 255)
  106.     NEXT
  107.     FOR sze = .25 TO s12 STEP .25
  108.         CIRCLE (x + (sz12) * COS(ra12), y + (sz12) * SIN(ra12)), sze, _RGB32(255, 255, 255)
  109.     NEXT
  110.     FOR sze = .25 TO s13 STEP .25
  111.         CIRCLE (x + (sz13) * COS(ra13), y + (sz13) * SIN(ra13)), sze, _RGB32(255, 255, 255)
  112.     NEXT
  113.     FOR sze = .25 TO s14 STEP .25
  114.         CIRCLE (x + (sz14) * COS(ra14), y + (sz14) * SIN(ra14)), sze, _RGB32(255, 255, 255)
  115.     NEXT
  116.     FOR sze = .25 TO s15 STEP .25
  117.         CIRCLE (x + (sz15) * COS(ra15), y + (sz15) * SIN(ra15)), sze, _RGB32(255, 255, 255)
  118.     NEXT
  119.     FOR sze = .25 TO s16 STEP .25
  120.         CIRCLE (x + (sz16) * COS(ra16), y + (sz16) * SIN(ra16)), sze, _RGB32(255, 255, 255)
  121.     NEXT
  122.  
  123.     'Speed
  124.     sz = sz + .25
  125.     sz2 = sz2 + .25
  126.     sz3 = sz3 + .25
  127.     sz4 = sz4 + .35
  128.     sz5 = sz5 + .35
  129.     sz6 = sz6 + .5
  130.     sz7 = sz7 + .5
  131.     sz8 = sz8 + .75
  132.     sz9 = sz9 + 1
  133.     sz10 = sz10 + 1.25
  134.     sz11 = sz11 + 1.35
  135.     sz12 = sz12 + 1.45
  136.     sz13 = sz13 + 1.55
  137.     sz14 = sz14 + 1.65
  138.     sz15 = sz15 + 1.75
  139.     sz16 = sz16 + 1.85
  140.  
  141.     _DISPLAY
  142.     CLS
  143.  
  144.     IF sz > 700 THEN sz = 50: ra = _PI(2) * RND
  145.     IF sz2 > 750 THEN sz2 = 50: ra2 = _PI(2) * RND
  146.     IF sz3 > 800 THEN sz3 = 50: ra3 = _PI(2) * RND
  147.     IF sz4 > 850 THEN sz4 = 50: ra4 = _PI(2) * RND
  148.     IF sz5 > 900 THEN sz5 = 50: ra5 = _PI(2) * RND
  149.     IF sz6 > 925 THEN sz6 = 50: ra6 = _PI(2) * RND
  150.     IF sz7 > 950 THEN sz7 = 50: ra7 = _PI(2) * RND
  151.     IF sz8 > 975 THEN sz8 = 50: ra8 = _PI(2) * RND
  152.     IF sz9 > 985 THEN sz9 = 50: ra9 = _PI(2) * RND
  153.     IF sz10 > 1000 THEN sz10 = 50: ra10 = _PI(2) * RND
  154.     IF sz11 > 1010 THEN sz11 = 50: ra11 = _PI(2) * RND
  155.     IF sz12 > 1020 THEN sz12 = 50: ra12 = _PI(2) * RND
  156.     IF sz13 > 1030 THEN sz13 = 50: ra13 = _PI(2) * RND
  157.     IF sz14 > 1045 THEN sz14 = 50: ra14 = _PI(2) * RND
  158.     IF sz15 > 1070 THEN sz15 = 50: ra15 = _PI(2) * RND
  159.     IF sz16 > 1100 THEN sz16 = 50: ra16 = _PI(2) * RND
  160.     a$ = INKEY$
  161.     IF a$ = CHR$(27) THEN END
  162.  
  163.  
« Last Edit: June 15, 2020, 01:00:12 am by SierraKen »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Starfield 2020
« Reply #1 on: June 15, 2020, 04:11:52 pm »
Oh the power of arrays!

Code: QB64: [Select]
  1. 'Starfield 2020 - by Sierraken
  2. 'Made on June 14, 2020. modified by bplus 2020-06-15
  3. 'Use your mouse wheel to control speed. Esc to quit.
  4. 'Thanks to b+ for some of the math.
  5.  
  6. SCREEN _NEWIMAGE(600, 600, 32)
  7. x = 300: y = 300: limit = 425
  8.  
  9. nStars = 250
  10.  
  11. 'sz = 50
  12. 'sz2 = 50
  13. 'sz3 = 50
  14. 'sz4 = 50
  15. 'sz5 = 50
  16. 'sz6 = 50
  17. 'sz7 = 50
  18. 'sz8 = 50
  19. 'sz9 = 50
  20. 'sz10 = 50
  21. 'sz11 = 50
  22. 'sz12 = 50
  23. 'sz13 = 50
  24. 'sz14 = 50
  25. 'sz15 = 50
  26. 'sz16 = 50
  27. 'Speed
  28. DIM sz(1 TO nStars)
  29. FOR i = 1 TO nStars
  30.     sz(i) = RND * 15 + 1
  31.     IF sz(i) < 1 THEN sz(i) = 1
  32.  
  33.  
  34. 'ra = _PI(2) * RND
  35. 'ra2 = _PI(2) * RND
  36. 'ra3 = _PI(2) * RND
  37. 'ra4 = _PI(2) * RND
  38. 'ra5 = _PI(2) * RND
  39. 'ra6 = _PI(2) * RND
  40. 'ra7 = _PI(2) * RND
  41. 'ra8 = _PI(2) * RND
  42. 'ra9 = _PI(2) * RND
  43. 'ra10 = _PI(2) * RND
  44. 'ra11 = _PI(2) * RND
  45. 'ra12 = _PI(2) * RND
  46. 'ra13 = _PI(2) * RND
  47. 'ra14 = _PI(2) * RND
  48. 'ra15 = _PI(2) * RND
  49. 'ra16 = _PI(2) * RND
  50. DIM ra(1 TO nStars)
  51. FOR i = 1 TO nStars
  52.     ra(i) = _PI(2) * RND
  53.  
  54.  
  55. 'Size
  56. 's = 1
  57. 's2 = 1
  58. 's3 = 1.25
  59. 's4 = 1.25
  60. 's5 = 1.25
  61. 's6 = 1.25
  62. 's7 = 1.5
  63. 's8 = 1.5
  64. 's9 = 1.5
  65. 's10 = 1.75
  66. 's11 = 1.75
  67. 's12 = 2
  68. 's13 = 2.25
  69. 's14 = 2.5
  70. 's15 = 2.75
  71. 's16 = 3
  72. DIM s(1 TO nStars)
  73. FOR i = 1 TO nStars
  74.     s(i) = _ROUND(i * 3 / 16)
  75.     IF s(i) < 1 THEN s(i) = 1
  76.     IF s(i) > 3 THEN s(i) = 1
  77.     'PRINT s(i)
  78. 'END
  79.  
  80.  
  81. L = 200
  82.     _LIMIT L 'from mouse wheel calc
  83.     mouseWheel = 0
  84.         mouseWheel = mouseWheel + _MOUSEWHEEL
  85.         IF mouseWheel > 0 THEN L = L - 2
  86.         IF mouseWheel < 0 THEN L = L + 2
  87.     LOOP
  88.     IF L < 5 THEN L = 5
  89.     IF L > 1000 THEN L = 1000
  90.     w = L / 100
  91.     w$ = STR$(w)
  92.     _TITLE "Warp: " + w$ + "       Use your Mouse Wheel to control speed. Esc to quit."
  93.  
  94.     'FOR sze = .25 TO s STEP .25
  95.     '    CIRCLE (x + (sz) * COS(ra), y + (sz) * SIN(ra)), sze, _RGB32(255, 255, 255)
  96.     'NEXT
  97.     'FOR sze = .25 TO s2 STEP .25
  98.     '    CIRCLE (x + (sz2) * COS(ra2), y + (sz2) * SIN(ra2)), sze, _RGB32(255, 255, 255)
  99.     'NEXT
  100.     'FOR sze = .25 TO s3 STEP .25
  101.     '    CIRCLE (x + (sz3) * COS(ra3), y + (sz3) * SIN(ra3)), sze, _RGB32(255, 255, 255)
  102.     'NEXT
  103.     'FOR sze = .25 TO s4 STEP .25
  104.     '    CIRCLE (x + (sz4) * COS(ra4), y + (sz4) * SIN(ra4)), sze, _RGB32(255, 255, 255)
  105.     'NEXT
  106.     'FOR sze = .25 TO s5 STEP .25
  107.     '    CIRCLE (x + (sz5) * COS(ra5), y + (sz5) * SIN(ra5)), sze, _RGB32(255, 255, 255)
  108.     'NEXT
  109.     'FOR sze = .25 TO s6 STEP .25
  110.     '    CIRCLE (x + (sz6) * COS(ra6), y + (sz6) * SIN(ra6)), sze, _RGB32(255, 255, 255)
  111.     'NEXT
  112.     'FOR sze = .25 TO s7 STEP .25
  113.     '    CIRCLE (x + (sz7) * COS(ra7), y + (sz7) * SIN(ra7)), sze, _RGB32(255, 255, 255)
  114.     'NEXT
  115.     'FOR sze = .25 TO s8 STEP .25
  116.     '    CIRCLE (x + (sz8) * COS(ra8), y + (sz8) * SIN(ra8)), sze, _RGB32(255, 255, 255)
  117.     'NEXT
  118.     'FOR sze = .25 TO s9 STEP .25
  119.     '    CIRCLE (x + (sz9) * COS(ra9), y + (sz9) * SIN(ra9)), sze, _RGB32(255, 255, 255)
  120.     'NEXT
  121.     'FOR sze = .25 TO s10 STEP .25
  122.     '    CIRCLE (x + (sz10) * COS(ra10), y + (sz10) * SIN(ra10)), sze, _RGB32(255, 255, 255)
  123.     'NEXT
  124.     'FOR sze = .25 TO s11 STEP .25
  125.     '    CIRCLE (x + (sz11) * COS(ra11), y + (sz11) * SIN(ra11)), sze, _RGB32(255, 255, 255)
  126.     'NEXT
  127.     'FOR sze = .25 TO s12 STEP .25
  128.     '    CIRCLE (x + (sz12) * COS(ra12), y + (sz12) * SIN(ra12)), sze, _RGB32(255, 255, 255)
  129.     'NEXT
  130.     'FOR sze = .25 TO s13 STEP .25
  131.     '    CIRCLE (x + (sz13) * COS(ra13), y + (sz13) * SIN(ra13)), sze, _RGB32(255, 255, 255)
  132.     'NEXT
  133.     'FOR sze = .25 TO s14 STEP .25
  134.     '    CIRCLE (x + (sz14) * COS(ra14), y + (sz14) * SIN(ra14)), sze, _RGB32(255, 255, 255)
  135.     'NEXT
  136.     'FOR sze = .25 TO s15 STEP .25
  137.     '    CIRCLE (x + (sz15) * COS(ra15), y + (sz15) * SIN(ra15)), sze, _RGB32(255, 255, 255)
  138.     'NEXT
  139.     'FOR sze = .25 TO s16 STEP .25
  140.     '    CIRCLE (x + (sz16) * COS(ra16), y + (sz16) * SIN(ra16)), sze, _RGB32(255, 255, 255)
  141.     'NEXT
  142.  
  143.     'Speed
  144.     'sz = sz + .25
  145.     'sz2 = sz2 + .25
  146.     'sz3 = sz3 + .25
  147.     'sz4 = sz4 + .35
  148.     'sz5 = sz5 + .35
  149.     'sz6 = sz6 + .5
  150.     'sz7 = sz7 + .5
  151.     'sz8 = sz8 + .75
  152.     'sz9 = sz9 + 1
  153.     'sz10 = sz10 + 1.25
  154.     'sz11 = sz11 + 1.35
  155.     'sz12 = sz12 + 1.45
  156.     'sz13 = sz13 + 1.55
  157.     'sz14 = sz14 + 1.65
  158.     'sz15 = sz15 + 1.75
  159.     'sz16 = sz16 + 1.85
  160.  
  161.     FOR i = 1 TO nStars
  162.         FOR sze = .25 TO s(i) STEP .25
  163.             IF sz(i) < 1 THEN sz(i) = 1
  164.             CIRCLE (x + sz(i) * COS(ra(i)), y + sz(i) * SIN(ra(i))), sze, _RGB32(255, 255, 255)
  165.         NEXT
  166.     NEXT
  167.  
  168.     _DISPLAY
  169.     CLS
  170.     'IF sz > 700 THEN sz = 50: ra = _PI(2) * RND
  171.     'IF sz2 > 750 THEN sz2 = 50: ra2 = _PI(2) * RND
  172.     'IF sz3 > 800 THEN sz3 = 50: ra3 = _PI(2) * RND
  173.     'IF sz4 > 850 THEN sz4 = 50: ra4 = _PI(2) * RND
  174.     'IF sz5 > 900 THEN sz5 = 50: ra5 = _PI(2) * RND
  175.     'IF sz6 > 925 THEN sz6 = 50: ra6 = _PI(2) * RND
  176.     'IF sz7 > 950 THEN sz7 = 50: ra7 = _PI(2) * RND
  177.     'IF sz8 > 975 THEN sz8 = 50: ra8 = _PI(2) * RND
  178.     'IF sz9 > 985 THEN sz9 = 50: ra9 = _PI(2) * RND
  179.     'IF sz10 > 1000 THEN sz10 = 50: ra10 = _PI(2) * RND
  180.     'IF sz11 > 1010 THEN sz11 = 50: ra11 = _PI(2) * RND
  181.     'IF sz12 > 1020 THEN sz12 = 50: ra12 = _PI(2) * RND
  182.     'IF sz13 > 1030 THEN sz13 = 50: ra13 = _PI(2) * RND
  183.     'IF sz14 > 1045 THEN sz14 = 50: ra14 = _PI(2) * RND
  184.     'IF sz15 > 1070 THEN sz15 = 50: ra15 = _PI(2) * RND
  185.     'IF sz16 > 1100 THEN sz16 = 50: ra16 = _PI(2) * RND
  186.     FOR i = 1 TO nStars
  187.         sz(i) = sz(i) + _ROUND(i * 1 / 8 + .5)
  188.         IF sz(i) < 1 THEN sz(i) = 1
  189.         ' is x or y off screen?
  190.         IF x + sz(i) * COS(ra(i)) > _WIDTH OR x + sz(i) * COS(ra(i)) < 0 THEN sz(i) = RND * 30 + 1: s(i) = RND * 3 + 1: ra(i) = _PI(2) * RND
  191.         IF y + sz(i) * SIN(ra(i)) > _HEIGHT OR y + sz(i) * SIN(ra(i)) < 0 THEN sz(i) = RND * 30 + 1: s(i) = RND * 3 + 1: ra(i) = _PI(2) * RND
  192.     NEXT
  193.  
  194.  
  195.     a$ = INKEY$
  196.     IF a$ = CHR$(27) THEN END
  197.  
  198.  
  199.  

or same thing:
Code: QB64: [Select]
  1. 'Starfield 2020 - by Sierraken
  2. 'Made on June 14, 2020.      modified by B+ 2020-06-15
  3. 'Use your mouse wheel to control speed. Esc to quit.
  4. 'Thanks to b+ for some of the math.
  5.  
  6. SCREEN _NEWIMAGE(600, 600, 32)
  7. x = 300: y = 300: limit = 425: nStars = 250
  8.  
  9. 'Speed sz(), angle ra() and size s()
  10. DIM sz(1 TO nStars), ra(1 TO nStars), s(1 TO nStars)
  11. FOR i = 1 TO nStars
  12.     sz(i) = RND * 15 + 1
  13.     IF sz(i) < 1 THEN sz(i) = 1
  14.     ra(i) = _PI(2) * RND
  15.     s(i) = _ROUND(i * 3 / 16)
  16.     IF s(i) < 1 THEN s(i) = 1
  17.     IF s(i) > 3 THEN s(i) = 1
  18. L = 200
  19.     _LIMIT L 'from mouse wheel calc
  20.     mouseWheel = 0
  21.         mouseWheel = mouseWheel + _MOUSEWHEEL
  22.         IF mouseWheel > 0 THEN L = L - 2
  23.         IF mouseWheel < 0 THEN L = L + 2
  24.     LOOP
  25.     IF L < 5 THEN L = 5
  26.     IF L > 1000 THEN L = 1000
  27.     w = L / 100
  28.     w$ = STR$(w)
  29.     _TITLE "Warp: " + w$ + "       Use your Mouse Wheel to control speed. Esc to quit."
  30.     FOR i = 1 TO nStars
  31.         FOR sze = .25 TO s(i) STEP .25
  32.             IF sz(i) < 1 THEN sz(i) = 1
  33.             CIRCLE (x + sz(i) * COS(ra(i)), y + sz(i) * SIN(ra(i))), sze, _RGB32(255, 255, 255)
  34.         NEXT
  35.     NEXT
  36.     _DISPLAY
  37.     CLS
  38.     FOR i = 1 TO nStars
  39.         sz(i) = sz(i) + _ROUND(i * 1 / 8 + .5)
  40.         IF sz(i) < 1 THEN sz(i) = 1
  41.         ' is x or y off screen?
  42.         IF x + sz(i) * COS(ra(i)) > _WIDTH OR x + sz(i) * COS(ra(i)) < 0 THEN sz(i) = RND * 30 + 1: s(i) = RND * 3 + 1: ra(i) = _PI(2) * RND
  43.         IF y + sz(i) * SIN(ra(i)) > _HEIGHT OR y + sz(i) * SIN(ra(i)) < 0 THEN sz(i) = RND * 30 + 1: s(i) = RND * 3 + 1: ra(i) = _PI(2) * RND
  44.     NEXT
  45.     a$ = INKEY$
  46.     IF a$ = CHR$(27) THEN END
  47.  
  48.  


Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Starfield 2020
« Reply #2 on: June 15, 2020, 04:33:45 pm »
Amazing bplus, I will have to study those quite a bit. But, not deflecting yours, I just been working on this just now and went from 16 stars in memory to 32. Looks a lot better.

Code: QB64: [Select]
  1. 'Starfield 2020 - by Sierraken
  2. 'Made on June 15, 2020.
  3. 'Use your mouse wheel to control speed. Esc to quit.
  4. 'Thanks to b+ for some of the math.
  5. 'Updated from 16 stars in memory to 32.
  6.  
  7. SCREEN _NEWIMAGE(800, 600, 32)
  8. x = 400: y = 300
  9.  
  10. 'Speed
  11. sz = 50
  12. sz2 = 50
  13. sz3 = 50
  14. sz4 = 50
  15. sz5 = 50
  16. sz6 = 50
  17. sz7 = 50
  18. sz8 = 50
  19. sz9 = 50
  20. sz10 = 50
  21. sz11 = 50
  22. sz12 = 50
  23. sz13 = 50
  24. sz14 = 50
  25. sz15 = 50
  26. sz16 = 50
  27. sz17 = 50
  28. sz18 = 50
  29. sz19 = 50
  30. sz20 = 50
  31. sz21 = 50
  32. sz22 = 50
  33. sz23 = 50
  34. sz24 = 50
  35. sz25 = 50
  36. sz26 = 50
  37. sz27 = 50
  38. sz28 = 50
  39. sz29 = 50
  40. sz30 = 50
  41. sz31 = 50
  42. sz32 = 50
  43.  
  44. ra = _PI(2) * RND
  45. ra2 = _PI(2) * RND
  46. ra3 = _PI(2) * RND
  47. ra4 = _PI(2) * RND
  48. ra5 = _PI(2) * RND
  49. ra6 = _PI(2) * RND
  50. ra7 = _PI(2) * RND
  51. ra8 = _PI(2) * RND
  52. ra9 = _PI(2) * RND
  53. ra10 = _PI(2) * RND
  54. ra11 = _PI(2) * RND
  55. ra12 = _PI(2) * RND
  56. ra13 = _PI(2) * RND
  57. ra14 = _PI(2) * RND
  58. ra15 = _PI(2) * RND
  59. ra16 = _PI(2) * RND
  60. ra17 = _PI(2) * RND
  61. ra18 = _PI(2) * RND
  62. ra19 = _PI(2) * RND
  63. ra20 = _PI(2) * RND
  64. ra21 = _PI(2) * RND
  65. ra22 = _PI(2) * RND
  66. ra23 = _PI(2) * RND
  67. ra24 = _PI(2) * RND
  68. ra25 = _PI(2) * RND
  69. ra26 = _PI(2) * RND
  70. ra27 = _PI(2) * RND
  71. ra28 = _PI(2) * RND
  72. ra29 = _PI(2) * RND
  73. ra30 = _PI(2) * RND
  74. ra31 = _PI(2) * RND
  75. ra32 = _PI(2) * RND
  76.  
  77. 'Size
  78. s = 1
  79. s2 = 1
  80. s3 = 1.25
  81. s4 = 1.25
  82. s5 = 1.25
  83. s6 = 1.25
  84. s7 = 1.5
  85. s8 = 1.5
  86. s9 = 1.5
  87. s10 = 1.75
  88. s11 = 1.75
  89. s12 = 2
  90. s13 = 2.25
  91. s14 = 2.5
  92. s15 = 2.75
  93. s16 = 3
  94. s17 = 1
  95. s18 = 1
  96. s19 = 1.25
  97. s20 = 1.25
  98. s21 = 1.25
  99. s22 = 1.25
  100. s23 = 1.5
  101. s24 = 1.5
  102. s25 = 1.5
  103. s26 = 1.75
  104. s27 = 1.75
  105. s28 = 2
  106. s29 = 2.25
  107. s30 = 2.5
  108. s31 = 2.75
  109. s32 = 3
  110.  
  111. l = 300
  112.     _LIMIT l
  113.     mouseWheel = 0
  114.         mouseWheel = mouseWheel + _MOUSEWHEEL
  115.         IF mouseWheel > 0 THEN l = l - 2
  116.         IF mouseWheel < 0 THEN l = l + 2
  117.     LOOP
  118.     IF l < 20 THEN l = 20
  119.     IF l > 1000 THEN l = 1000
  120.     w = l / 100
  121.     w$ = STR$(w)
  122.     _TITLE "Warp: " + w$ + "       Use your Mouse Wheel to control speed. Esc to quit."
  123.     FOR sze = .25 TO s STEP .25
  124.         CIRCLE (x + (sz) * COS(ra), y + (sz) * SIN(ra)), sze, _RGB32(255, 255, 255)
  125.     NEXT
  126.     FOR sze = .25 TO s2 STEP .25
  127.         CIRCLE (x + (sz2) * COS(ra2), y + (sz2) * SIN(ra2)), sze, _RGB32(255, 255, 255)
  128.     NEXT
  129.     FOR sze = .25 TO s3 STEP .25
  130.         CIRCLE (x + (sz3) * COS(ra3), y + (sz3) * SIN(ra3)), sze, _RGB32(255, 255, 255)
  131.     NEXT
  132.     FOR sze = .25 TO s4 STEP .25
  133.         CIRCLE (x + (sz4) * COS(ra4), y + (sz4) * SIN(ra4)), sze, _RGB32(255, 255, 255)
  134.     NEXT
  135.     FOR sze = .25 TO s5 STEP .25
  136.         CIRCLE (x + (sz5) * COS(ra5), y + (sz5) * SIN(ra5)), sze, _RGB32(255, 255, 255)
  137.     NEXT
  138.     FOR sze = .25 TO s6 STEP .25
  139.         CIRCLE (x + (sz6) * COS(ra6), y + (sz6) * SIN(ra6)), sze, _RGB32(255, 255, 255)
  140.     NEXT
  141.     FOR sze = .25 TO s7 STEP .25
  142.         CIRCLE (x + (sz7) * COS(ra7), y + (sz7) * SIN(ra7)), sze, _RGB32(255, 255, 255)
  143.     NEXT
  144.     FOR sze = .25 TO s8 STEP .25
  145.         CIRCLE (x + (sz8) * COS(ra8), y + (sz8) * SIN(ra8)), sze, _RGB32(255, 255, 255)
  146.     NEXT
  147.     FOR sze = .25 TO s9 STEP .25
  148.         CIRCLE (x + (sz9) * COS(ra9), y + (sz9) * SIN(ra9)), sze, _RGB32(255, 255, 255)
  149.     NEXT
  150.     FOR sze = .25 TO s10 STEP .25
  151.         CIRCLE (x + (sz10) * COS(ra10), y + (sz10) * SIN(ra10)), sze, _RGB32(255, 255, 255)
  152.     NEXT
  153.     FOR sze = .25 TO s11 STEP .25
  154.         CIRCLE (x + (sz11) * COS(ra11), y + (sz11) * SIN(ra11)), sze, _RGB32(255, 255, 255)
  155.     NEXT
  156.     FOR sze = .25 TO s12 STEP .25
  157.         CIRCLE (x + (sz12) * COS(ra12), y + (sz12) * SIN(ra12)), sze, _RGB32(255, 255, 255)
  158.     NEXT
  159.     FOR sze = .25 TO s13 STEP .25
  160.         CIRCLE (x + (sz13) * COS(ra13), y + (sz13) * SIN(ra13)), sze, _RGB32(255, 255, 255)
  161.     NEXT
  162.     FOR sze = .25 TO s14 STEP .25
  163.         CIRCLE (x + (sz14) * COS(ra14), y + (sz14) * SIN(ra14)), sze, _RGB32(255, 255, 255)
  164.     NEXT
  165.     FOR sze = .25 TO s15 STEP .25
  166.         CIRCLE (x + (sz15) * COS(ra15), y + (sz15) * SIN(ra15)), sze, _RGB32(255, 255, 255)
  167.     NEXT
  168.     FOR sze = .25 TO s16 STEP .25
  169.         CIRCLE (x + (sz16) * COS(ra16), y + (sz16) * SIN(ra16)), sze, _RGB32(255, 255, 255)
  170.     NEXT
  171.     FOR sze = .25 TO s17 STEP .25
  172.         CIRCLE (x + (sz17) * COS(ra17), y + (sz17) * SIN(ra17)), sze, _RGB32(255, 255, 255)
  173.     NEXT
  174.     FOR sze = .25 TO s18 STEP .25
  175.         CIRCLE (x + (sz18) * COS(ra18), y + (sz18) * SIN(ra18)), sze, _RGB32(255, 255, 255)
  176.     NEXT
  177.     FOR sze = .25 TO s19 STEP .25
  178.         CIRCLE (x + (sz19) * COS(ra19), y + (sz19) * SIN(ra19)), sze, _RGB32(255, 255, 255)
  179.     NEXT
  180.     FOR sze = .25 TO s20 STEP .25
  181.         CIRCLE (x + (sz20) * COS(ra20), y + (sz20) * SIN(ra20)), sze, _RGB32(255, 255, 255)
  182.     NEXT
  183.     FOR sze = .25 TO s21 STEP .25
  184.         CIRCLE (x + (sz21) * COS(ra21), y + (sz21) * SIN(ra21)), sze, _RGB32(255, 255, 255)
  185.     NEXT
  186.     FOR sze = .25 TO s22 STEP .25
  187.         CIRCLE (x + (sz22) * COS(ra22), y + (sz22) * SIN(ra22)), sze, _RGB32(255, 255, 255)
  188.     NEXT
  189.     FOR sze = .25 TO s23 STEP .25
  190.         CIRCLE (x + (sz23) * COS(ra23), y + (sz23) * SIN(ra23)), sze, _RGB32(255, 255, 255)
  191.     NEXT
  192.     FOR sze = .25 TO s24 STEP .25
  193.         CIRCLE (x + (sz24) * COS(ra24), y + (sz24) * SIN(ra24)), sze, _RGB32(255, 255, 255)
  194.     NEXT
  195.     FOR sze = .25 TO s25 STEP .25
  196.         CIRCLE (x + (sz25) * COS(ra25), y + (sz25) * SIN(ra25)), sze, _RGB32(255, 255, 255)
  197.     NEXT
  198.     FOR sze = .25 TO s26 STEP .25
  199.         CIRCLE (x + (sz26) * COS(ra26), y + (sz26) * SIN(ra26)), sze, _RGB32(255, 255, 255)
  200.     NEXT
  201.     FOR sze = .25 TO s27 STEP .25
  202.         CIRCLE (x + (sz27) * COS(ra27), y + (sz27) * SIN(ra27)), sze, _RGB32(255, 255, 255)
  203.     NEXT
  204.     FOR sze = .25 TO s28 STEP .25
  205.         CIRCLE (x + (sz28) * COS(ra28), y + (sz28) * SIN(ra28)), sze, _RGB32(255, 255, 255)
  206.     NEXT
  207.     FOR sze = .25 TO s29 STEP .25
  208.         CIRCLE (x + (sz29) * COS(ra29), y + (sz29) * SIN(ra29)), sze, _RGB32(255, 255, 255)
  209.     NEXT
  210.     FOR sze = .25 TO s30 STEP .25
  211.         CIRCLE (x + (sz30) * COS(ra30), y + (sz30) * SIN(ra30)), sze, _RGB32(255, 255, 255)
  212.     NEXT
  213.     FOR sze = .25 TO s31 STEP .25
  214.         CIRCLE (x + (sz31) * COS(ra31), y + (sz31) * SIN(ra31)), sze, _RGB32(255, 255, 255)
  215.     NEXT
  216.     FOR sze = .25 TO s32 STEP .25
  217.         CIRCLE (x + (sz32) * COS(ra32), y + (sz32) * SIN(ra32)), sze, _RGB32(255, 255, 255)
  218.     NEXT
  219.  
  220.     'Speed
  221.     sz = sz + .25
  222.     sz2 = sz2 + .25
  223.     sz3 = sz3 + .25
  224.     sz4 = sz4 + .35
  225.     sz5 = sz5 + .35
  226.     sz6 = sz6 + .5
  227.     sz7 = sz7 + .5
  228.     sz8 = sz8 + .75
  229.     sz9 = sz9 + 1
  230.     sz10 = sz10 + 1.25
  231.     sz11 = sz11 + 1.35
  232.     sz12 = sz12 + 1.45
  233.     sz13 = sz13 + 1.55
  234.     sz14 = sz14 + 1.65
  235.     sz15 = sz15 + 1.75
  236.     sz16 = sz16 + 1.85
  237.     sz17 = sz17 + .25
  238.     sz18 = sz18 + .25
  239.     sz19 = sz19 + .25
  240.     sz20 = sz20 + .35
  241.     sz21 = sz21 + .35
  242.     sz22 = sz22 + .5
  243.     sz23 = sz23 + .5
  244.     sz24 = sz24 + .75
  245.     sz25 = sz25 + 1
  246.     sz26 = sz26 + 1.25
  247.     sz27 = sz27 + 1.35
  248.     sz28 = sz28 + 1.45
  249.     sz29 = sz29 + 1.55
  250.     sz30 = sz30 + 1.65
  251.     sz31 = sz31 + 1.75
  252.     sz32 = sz32 + 1.85
  253.  
  254.     _DISPLAY
  255.     CLS
  256.  
  257.     IF sz > 700 THEN sz = 50: ra = _PI(2) * RND
  258.     IF sz2 > 750 THEN sz2 = 50: ra2 = _PI(2) * RND
  259.     IF sz3 > 800 THEN sz3 = 50: ra3 = _PI(2) * RND
  260.     IF sz4 > 850 THEN sz4 = 50: ra4 = _PI(2) * RND
  261.     IF sz5 > 900 THEN sz5 = 50: ra5 = _PI(2) * RND
  262.     IF sz6 > 925 THEN sz6 = 50: ra6 = _PI(2) * RND
  263.     IF sz7 > 950 THEN sz7 = 50: ra7 = _PI(2) * RND
  264.     IF sz8 > 975 THEN sz8 = 50: ra8 = _PI(2) * RND
  265.     IF sz9 > 985 THEN sz9 = 50: ra9 = _PI(2) * RND
  266.     IF sz10 > 1000 THEN sz10 = 50: ra10 = _PI(2) * RND
  267.     IF sz11 > 1010 THEN sz11 = 50: ra11 = _PI(2) * RND
  268.     IF sz12 > 1020 THEN sz12 = 50: ra12 = _PI(2) * RND
  269.     IF sz13 > 1030 THEN sz13 = 50: ra13 = _PI(2) * RND
  270.     IF sz14 > 1045 THEN sz14 = 50: ra14 = _PI(2) * RND
  271.     IF sz15 > 1070 THEN sz15 = 50: ra15 = _PI(2) * RND
  272.     IF sz16 > 1100 THEN sz16 = 50: ra16 = _PI(2) * RND
  273.     IF sz17 > 700 THEN sz17 = 50: ra17 = _PI(2) * RND
  274.     IF sz18 > 750 THEN sz18 = 50: ra18 = _PI(2) * RND
  275.     IF sz19 > 800 THEN sz19 = 50: ra19 = _PI(2) * RND
  276.     IF sz20 > 850 THEN sz20 = 50: ra20 = _PI(2) * RND
  277.     IF sz21 > 900 THEN sz21 = 50: ra21 = _PI(2) * RND
  278.     IF sz22 > 925 THEN sz22 = 50: ra22 = _PI(2) * RND
  279.     IF sz23 > 950 THEN sz23 = 50: ra23 = _PI(2) * RND
  280.     IF sz24 > 975 THEN sz24 = 50: ra24 = _PI(2) * RND
  281.     IF sz25 > 985 THEN sz25 = 50: ra25 = _PI(2) * RND
  282.     IF sz26 > 1000 THEN sz26 = 50: ra26 = _PI(2) * RND
  283.     IF sz27 > 1010 THEN sz27 = 50: ra27 = _PI(2) * RND
  284.     IF sz28 > 1020 THEN sz28 = 50: ra28 = _PI(2) * RND
  285.     IF sz29 > 1030 THEN sz29 = 50: ra29 = _PI(2) * RND
  286.     IF sz30 > 1045 THEN sz30 = 50: ra30 = _PI(2) * RND
  287.     IF sz31 > 1070 THEN sz31 = 50: ra31 = _PI(2) * RND
  288.     IF sz32 > 1100 THEN sz32 = 50: ra32 = _PI(2) * RND
  289.  
  290.     a$ = INKEY$
  291.     IF a$ = CHR$(27) THEN END
  292.  
  293.  

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Starfield 2020
« Reply #3 on: June 15, 2020, 04:41:34 pm »
Hey @SierraKen this is perfect demo for learning arrays, creating and assigning tons of variables and values with loops.

Keep your (i) on the index (of the array) :-))