Author Topic: Merry Christmas QB64.org Forum!  (Read 3583 times)

0 Members and 1 Guest are viewing this topic.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Merry Christmas QB64.org Forum!
« on: December 23, 2019, 03:27:06 pm »
This morning I made this gift for you all to have for all the help you have done for me this year in learning about the language. Thank you!
Feel free to change anything you wish and re-post if you want. After it loads, press the Space Bar to re-decorate.

Code: QB64: [Select]
  1. _TITLE "Merry Christmas QB64.org Forum! - Press Space Bar To Re-Decorate."
  2. start:
  3. t = 0
  4. tt = 0
  5. _LIMIT 500
  6. picture& = _NEWIMAGE(800, 600, 32)
  7. SCREEN picture&
  8. 'Draw sky.
  9. sky = INT(RND * 200) + 55
  10. FOR sk = 0 TO 299
  11.     sky = sky + .25
  12.     IF sky > 255 THEN sky = 255
  13.     LINE (0, sk)-(800, sk), _RGB32(0, 0, sky)
  14. NEXT sk
  15. 'Draw ground.
  16. cc21 = INT(RND * 255)
  17. cc22 = INT(RND * 200)
  18. cc23 = INT(RND * 255)
  19. FOR cc = 300 TO 600
  20.     cc2 = cc2 + 1
  21.     LINE (0, cc)-(800, cc), _RGB32(cc21, cc22, cc23)
  22. NEXT cc
  23. y = 300
  24. c1 = INT(RND * 100) + 20
  25. c2 = INT(RND * 150) + 60
  26. c4 = c2
  27. c3 = INT(RND * 100) + 20
  28. 'Christmas Tree
  29. LINE (380, 520)-(420, 200), _RGB32(127, 255, 127), BF
  30. 'Right Side
  31. LINE (400, 180)-(475, 255), _RGB32(127, 255, 127)
  32. LINE (475, 255)-(420, 255), _RGB32(127, 255, 127)
  33. PAINT (430, 240), _RGB32(127, 255, 127)
  34. LINE (420, 255)-(495, 330), _RGB32(127, 255, 127)
  35. LINE (495, 330)-(420, 330), _RGB32(127, 255, 127)
  36. PAINT (430, 300), _RGB32(127, 255, 127)
  37. LINE (420, 330)-(515, 405), _RGB32(127, 255, 127)
  38. LINE (515, 405)-(420, 405), _RGB32(127, 255, 127)
  39. PAINT (500, 400), _RGB32(127, 255, 127)
  40. LINE (420, 405)-(535, 480), _RGB32(127, 255, 127)
  41. LINE (535, 480)-(420, 480), _RGB32(127, 255, 127)
  42. PAINT (430, 470), _RGB32(127, 255, 127)
  43. 'Left Side
  44. LINE (400, 180)-(325, 255), _RGB32(127, 255, 127)
  45. LINE (325, 255)-(380, 255), _RGB32(127, 255, 127)
  46. PAINT (350, 240), _RGB32(127, 255, 127)
  47. LINE (380, 255)-(305, 330), _RGB32(127, 255, 127)
  48. LINE (305, 330)-(380, 330), _RGB32(127, 255, 127)
  49. PAINT (350, 300), _RGB32(127, 255, 127)
  50. LINE (380, 330)-(285, 405), _RGB32(127, 255, 127)
  51. LINE (285, 405)-(380, 405), _RGB32(127, 255, 127)
  52. PAINT (300, 400), _RGB32(127, 255, 127)
  53. LINE (380, 405)-(265, 480), _RGB32(127, 255, 127)
  54. LINE (265, 480)-(380, 480), _RGB32(127, 255, 127)
  55. PAINT (300, 460), _RGB32(127, 255, 127)
  56. 'Tip
  57. PAINT (400, 195), _RGB32(127, 255, 127)
  58. 'Star
  59. LINE (390, 185)-(400, 160), _RGB32(255, 255, 255)
  60. LINE (400, 160)-(410, 185), _RGB32(255, 255, 255)
  61. LINE (410, 185)-(390, 170), _RGB32(255, 255, 255)
  62. LINE (390, 170)-(410, 170), _RGB32(255, 255, 255)
  63. LINE (410, 170)-(390, 185), _RGB32(255, 255, 255)
  64. 'tinsel
  65. amount = 250
  66.     tx = INT(RND * 800)
  67.     ty = INT(RND * 595) + 205
  68.     IF POINT(tx, ty) = _RGB32(127, 255, 127) THEN
  69.         tt = tt + 1
  70.         IF tt > amount THEN GOTO nex:
  71.         RANDOMIZE TIMER
  72.         tc1 = 244
  73.         tc2 = 244
  74.         tc3 = 244
  75.         sz2 = INT(RND * 8) + 3
  76.         FOR sz = .25 TO sz2 STEP .25
  77.             tc1 = tc1 + 1
  78.             tc2 = tc2 + 1
  79.             tc3 = tc3 + 1
  80.             LINE (tx, ty)-(tx, ty + sz), _RGB32(tc1, tc2, tc3)
  81.         NEXT sz
  82.     END IF
  83. nex:
  84.  
  85.  
  86. 'Random Ornaments
  87. amount2 = 50
  88.     ox = INT(RND * 800)
  89.     oy = INT(RND * 595) + 205
  90.     IF POINT(ox, oy) = _RGB32(127, 255, 127) THEN
  91.         t = t + 1
  92.         IF t > amount2 THEN GOTO nex2:
  93.         RANDOMIZE TIMER
  94.         co1 = INT(RND * 155) + 100
  95.         co2 = INT(RND * 155) + 100
  96.         co3 = INT(RND * 155) + 100
  97.         sz2 = INT(RND * 8) + 3
  98.         FOR sz = .25 TO sz2 STEP .25
  99.             co1 = co1 - 1
  100.             co2 = co2 - 1
  101.             co3 = co3 - 1
  102.             CIRCLE (ox, oy), sz, _RGB32(co1, co2, co3)
  103.         NEXT sz
  104.     END IF
  105. nex2:
  106. a$ = INKEY$
  107. IF a$ = " " THEN GOTO start:
  108. IF a$ = CHR$(27) THEN END
  109. GOTO nex2:
  110.  
« Last Edit: December 23, 2019, 03:30:23 pm by SierraKen »

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: Merry Christmas QB64.org Forum!
« Reply #1 on: December 23, 2019, 10:35:41 pm »
@Sierra Ken

Thanks for gift!

Merry Christmas!

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Merry Christmas QB64.org Forum!
« Reply #2 on: December 24, 2019, 07:35:05 am »
Thank You, SierraKen. Merry Christmas!  Petr