Author Topic: Mother's day theme  (Read 936 times)

0 Members and 1 Guest are viewing this topic.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
Mother's day theme
« on: May 12, 2019, 10:01:09 am »
Thematic Video for motherĀ“s day:


Code: QB64: [Select]
  1. CONST W = 728
  2. CONST H = 663
  3. SCREEN _NEWIMAGE(W, H, 32)
  4.  
  5. CLS , _RGB32(127, 127, 127)
  6.  
  7. _TITLE "Happy mothers day!"
  8. DO UNTIL _KEYHIT = 32: LOOP 'for screen recorder init
  9.  
  10. REDIM p AS p
  11. REDIM p2 AS p
  12. DIM lenght AS LONG
  13.  
  14. OPEN "srdce.bin" FOR BINARY AS #1
  15. GET #1, , lenght
  16. REDIM p(lenght) AS p
  17. GET #1, , p()
  18.  
  19. OPEN "napis.bin" FOR BINARY AS #2
  20. GET #2, , lenght
  21. REDIM p2(lenght) AS p
  22. GET #2, , p2()
  23.  
  24.  
  25.  
  26. DIM Frame(10) AS LONG
  27. videopicture& = _LOADIMAGE("fxfire1.jpg", 32)
  28. x = 1: y = 1
  29. FOR VideoFramesLoad = 1 TO 10
  30.     Frame&(VideoFramesLoad) = _NEWIMAGE(64, 64, 32)
  31.     _PUTIMAGE (0, 0), videopicture&, Frame&(VideoFramesLoad), (x, y)-(x + 64, y + 64)
  32.     _SETALPHA 0, _RGB32(0, 0, 0) TO _RGB32(100, 150, 160), Frame&(VideoFramesLoad)
  33.     x = x + 64: IF x > 3 * 64 THEN x = 1: y = y + 64
  34. NEXT VideoFramesLoad
  35. tl = TIMER
  36. hi = 0
  37.     VideoPlay = VideoPlay + 1
  38.     IF VideoPlay > 10 THEN VideoPlay = 1
  39.         Mx = _MOUSEX
  40.         My = _MOUSEY
  41.         Mw = _MOUSEWHEEL(1)
  42.         zoom = zoom + (Mw * 2)
  43.     WEND
  44.     CLS , _RGB32(128, 128, 128)
  45.  
  46.     IF TIMER > delay THEN
  47.         in = in + 1: IF in > UBOUND(p) THEN in = UBOUND(p): faze2 = 1
  48.         IF faze2 THEN in2 = in2 + 1
  49.         IF in2 > UBOUND(p2) THEN in2 = UBOUND(p2)
  50.         delay = TIMER + .1
  51.         ' PRINT in: _DISPLAY
  52.     END IF
  53.  
  54.  
  55.     FOR sh = 0 TO in - 1 STEP 3
  56.         _PUTIMAGE (p(sh).x - 32, p(sh).y - 32)-(p(sh).x + 32 + zoom, p(sh).y + 32 + zoom), Frame&(VideoPlay) '
  57.     NEXT
  58.  
  59.     IF faze2 THEN
  60.         FOR sh2 = 0 TO in2 - 1 STEP 1
  61.             _PUTIMAGE (p2(sh2).x - 8, p2(sh2).y - 8)-(p2(sh2).x + 8 + zoom, p2(sh2).y + 8 + zoom), Frame&(VideoPlay) '
  62.         NEXT
  63.     END IF
  64.  
  65.  
  66.     IF TIMER > tl + 45 THEN
  67.         hi = hi + 1
  68.         LINE (0, 0)-(W, H), _RGBA32(0, 0, 0, hi), BF
  69.     END IF
  70.     _DISPLAY
  71.     _LIMIT 10
  72. LOOP UNTIL hi > 250
  73.  
  74. i = 0
  75. REDIM src(0) AS STRING
  76. OPEN "srdce1.bas" FOR INPUT AS #3
  77.     LINE INPUT #3, src(i)
  78.     i = i + 1
  79.     REDIM _PRESERVE src(i) AS STRING
  80. LOCATE 1, 1: PRINT "Source code for this video:"
  81. FOR s = LBOUND(src) TO UBOUND(src)
  82.     PRINT src(s)
  83.     _DELAY .1
  84. t:
  85. _PRINTSTRING (W - 480, H / 2), "Visit QB64.ORG for more... :-D"
  86.  
  87.  
« Last Edit: May 12, 2019, 10:04:51 am by Petr »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: Mother's day theme
« Reply #1 on: May 12, 2019, 11:08:47 am »
Hi Petr,

Nice! Your mom should be proud.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
Re: Mother's day theme
« Reply #2 on: May 12, 2019, 12:17:10 pm »
Thank you, Bplus :-D