Author Topic: More Sky Chickens  (Read 5206 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
More Sky Chickens
« on: October 14, 2018, 11:35:44 am »
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. _SCREENMOVE 300, 50
  3. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  4. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  5. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  6. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  7. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  8. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  9. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  10. DATA 0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0
  11. DATA 1,1,0,0,1,0,0,1,0,0,1,0,0,1,1,0
  12. DATA 0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0
  13. DATA 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0
  14. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  15. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  16. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  17. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  18. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  19.  
  20. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  21. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  22. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  23. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  24. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  25. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  26. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  27. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  28. DATA 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0
  29. DATA 0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0
  30. DATA 0,0,0,0,1,0,1,1,1,0,0,1,0,0,0,0
  31. DATA 0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0
  32. DATA 0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0
  33. DATA 0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0
  34. DATA 0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0
  35. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  36.  
  37.  
  38. DIM SHARED sprt(15, 15)
  39. FOR y = 0 TO 15
  40.     FOR x = 0 TO 15
  41.         READ sprt(x, y)
  42.     NEXT
  43.  
  44. DIM SHARED sprt2(15, 15)
  45. FOR y = 0 TO 15
  46.     FOR x = 0 TO 15
  47.         READ sprt2(x, y)
  48.     NEXT
  49.  
  50. TYPE btype
  51.     x AS SINGLE
  52.     y AS SINGLE
  53.     f AS INTEGER
  54.     a AS SINGLE
  55.  
  56. DIM SHARED bs(10000) AS btype
  57. bi = -1
  58.     CLS , _RGB32(0, 0, 128)
  59.     nloop = nloop + 1
  60.     IF RND < .15 AND (bi + 1) < 10000 THEN
  61.         bi = bi + 1
  62.         newb bi
  63.     END IF
  64.     FOR i = 0 TO bi
  65.         drawb i
  66.     NEXT
  67.     _DISPLAY
  68.     _LIMIT 20
  69.  
  70. SUB newb (i)
  71.     bs(i).x = 800 + RND * 320
  72.     bs(i).y = 600 + RND * 80
  73.     bs(i).f = INT(RND * 2)
  74.     bs(i).a = 0
  75.  
  76. SUB drawb (i)
  77.     IF bs(i).a < _PI(16) AND bs(i).y < 580 AND bs(i).y > -100 THEN
  78.         bs(i).a = bs(i).a + _PI(1 / 144)
  79.         bs(i).x = bs(i).x + bs(i).a * COS(bs(i).a)
  80.         bs(i).y = bs(i).y + .2 * bs(i).a * SIN(bs(i).a)
  81.         bs(i).y = bs(i).y - .2
  82.     ELSE
  83.         bs(i).x = bs(i).x - (RND * 8 + 2)
  84.         bs(i).y = bs(i).y - (RND * 6 + 1)
  85.     END IF
  86.     IF bs(i).y < -160 THEN newb i
  87.     bs(i).f = (bs(i).f + 1) MOD 10
  88.     sz = (600 - bs(i).y) * .006
  89.     IF bs(i).f = 0 OR bs(i).f = 1 THEN
  90.         FOR y = 0 TO 15
  91.             FOR x = 0 TO 15
  92.                 IF sprt2(x, y) THEN LINE (x * sz + bs(i).x, y * sz + bs(i).y)-STEP(sz, sz), _RGB32(0, 0, 0), BF
  93.             NEXT
  94.         NEXT
  95.     ELSE
  96.         FOR y = 0 TO 15
  97.             FOR x = 0 TO 15
  98.                 IF sprt(x, y) THEN LINE (x * sz + bs(i).x, y * sz + bs(i).y)-STEP(sz, sz), _RGB32(0, 0, 0), BF
  99.             NEXT
  100.         NEXT
  101.     END IF
  102.  
  103.  

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: More Sky Chickens
« Reply #1 on: October 14, 2018, 04:40:38 pm »
Hitchcock would have been proud of THAT display! (...as well as Colonel Sanders!) Great job!
Logic is the beginning of wisdom.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: More Sky Chickens
« Reply #2 on: October 17, 2018, 05:28:01 pm »
Hi Bplus
very cool all these flying  birds!
Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: More Sky Chickens
« Reply #3 on: October 17, 2018, 07:34:19 pm »
Ha! Don't they look familiar? ;D

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: More Sky Chickens
« Reply #4 on: October 18, 2018, 07:25:46 pm »
not in the blue :-)
Programming isn't difficult, only it's  consuming time and coffee

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: More Sky Chickens
« Reply #5 on: October 19, 2018, 03:32:00 am »
Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. _SCREENMOVE 300, 50
  3.  
  4. CONST lightblue = _RGB32(128, 128, 255)
  5.  
  6. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  7. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  8. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  9. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  10. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  11. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  12. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  13. DATA 0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0
  14. DATA 1,1,0,0,1,0,0,1,0,0,1,0,0,1,1,0
  15. DATA 0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0
  16. DATA 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0
  17. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  18. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  19. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  20. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  21. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  22.  
  23. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  24. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  25. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  26. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  27. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  28. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  29. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  30. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  31. DATA 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0
  32. DATA 0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0
  33. DATA 0,0,0,0,1,0,1,1,1,0,0,1,0,0,0,0
  34. DATA 0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0
  35. DATA 0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0
  36. DATA 0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0
  37. DATA 0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0
  38. DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  39.  
  40.  
  41. DIM SHARED sprt(15, 15)
  42. FOR y = 0 TO 15
  43.     FOR x = 0 TO 15
  44.         READ sprt(x, y)
  45.     NEXT
  46.  
  47. DIM SHARED sprt2(15, 15)
  48. FOR y = 0 TO 15
  49.     FOR x = 0 TO 15
  50.         READ sprt2(x, y)
  51.     NEXT
  52.  
  53. TYPE btype
  54.     x AS SINGLE
  55.     y AS SINGLE
  56.     f AS INTEGER
  57.     a AS SINGLE
  58.  
  59. DIM SHARED bs(10000) AS btype
  60. bi = -1
  61.     CLS , _RGB32(0, 0, 128)
  62.     nloop = nloop + 1
  63.     IF RND < .15 AND (bi + 1) < 10000 THEN
  64.         bi = bi + 1
  65.         newb bi
  66.     END IF
  67.     FOR i = 0 TO bi
  68.         drawb i
  69.     NEXT
  70.     _DISPLAY
  71.     _LIMIT 20
  72.  
  73. SUB newb (i)
  74.     bs(i).x = 800 + RND * 320
  75.     bs(i).y = 600 + RND * 80
  76.     bs(i).f = INT(RND * 2)
  77.     bs(i).a = 0
  78.  
  79. SUB drawb (i)
  80.     IF bs(i).a < _PI(16) AND bs(i).y < 580 AND bs(i).y > -100 THEN
  81.         bs(i).a = bs(i).a + _PI(1 / 144)
  82.         bs(i).x = bs(i).x + bs(i).a * COS(bs(i).a)
  83.         bs(i).y = bs(i).y + .2 * bs(i).a * SIN(bs(i).a)
  84.         bs(i).y = bs(i).y - .2
  85.     ELSE
  86.         bs(i).x = bs(i).x - (RND * 8 + 2)
  87.         bs(i).y = bs(i).y - (RND * 6 + 1)
  88.     END IF
  89.     IF bs(i).y < -160 THEN newb i
  90.     bs(i).f = (bs(i).f + 1) MOD 10
  91.     sz = (600 - bs(i).y) * .006
  92.     IF bs(i).f = 0 OR bs(i).f = 1 THEN
  93.         FOR y = 0 TO 15
  94.             FOR x = 0 TO 15
  95.                 IF sprt2(x, y) THEN LINE (x * sz + bs(i).x, y * sz + bs(i).y)-STEP(sz, sz), lightblue, BF
  96.             NEXT
  97.         NEXT
  98.     ELSE
  99.         FOR y = 0 TO 15
  100.             FOR x = 0 TO 15
  101.                 IF sprt(x, y) THEN LINE (x * sz + bs(i).x, y * sz + bs(i).y)-STEP(sz, sz), lightblue, BF
  102.             NEXT
  103.         NEXT
  104.     END IF
  105.  

Blue. As per your request... lol

J
Logic is the beginning of wisdom.