Author Topic: Happy Halloween!  (Read 3119 times)

0 Members and 1 Guest are viewing this topic.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Happy Halloween!
« on: October 31, 2020, 04:47:20 pm »
Warning: It has some flashes so if you are sensitive to light flashing, don't use this.

Happy Halloween everyone!

Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(800, 600, 32)
  2. _TITLE "Jack-O-Lantern From SierraKen"
  3. 'Stand
  4. FOR my = 350 TO 425 STEP .2
  5.     CIRCLE (400, my), 200, _RGB32(109, 39, 2), _PI, 2 * _PI, .75
  6. NEXT my
  7.     'Pumpkin
  8.     CIRCLE (400, 300), 200, _RGB32(226, 90, 1), , , .85
  9.     PAINT (400, 300), _RGB32(226, 90, 1)
  10.     'Left Eye
  11.     LINE (320, 200)-(270, 250), _RGB32(109, 39, 0)
  12.     LINE (270, 250)-(370, 250), _RGB32(109, 39, 0)
  13.     LINE (370, 250)-(320, 200), _RGB32(109, 39, 0)
  14.     PAINT (340, 230), _RGB32(109, 39, 0)
  15.     'Right Eye
  16.     LINE (480, 200)-(430, 250), _RGB32(109, 39, 0)
  17.     LINE (430, 250)-(530, 250), _RGB32(109, 39, 0)
  18.     LINE (530, 250)-(480, 200), _RGB32(109, 39, 0)
  19.     PAINT (500, 230), _RGB32(109, 39, 0)
  20.     'Nose
  21.     LINE (400, 275)-(350, 325), _RGB32(109, 39, 0)
  22.     LINE (350, 325)-(450, 325), _RGB32(109, 39, 0)
  23.     LINE (450, 325)-(400, 275), _RGB32(109, 39, 0)
  24.     PAINT (420, 310), _RGB32(109, 39, 0)
  25.     'Mouth
  26.     FOR my = 325 TO 375 STEP .2
  27.         CIRCLE (400, my), 100, _RGB32(109, 39, 0), _PI, 2 * _PI, .75
  28.     NEXT my
  29.     'Green Stem
  30.     FOR sx = 355 TO 345 STEP -.2
  31.         CIRCLE (sx, 130), 50, _RGB32(127, 194, 127), 2 * _PI, _PI / 2
  32.     NEXT sx
  33.     'Candle
  34.     tim = INT(RND * 2000) + 1
  35.     IF tim > 500 THEN
  36.         FOR x = 1 TO 800
  37.             FOR y = 1 TO 600
  38.                 IF POINT(x, y) = _RGB32(109, 39, 0) THEN
  39.                     PSET (x, y), _RGB32(233, 139, 127)
  40.                 END IF
  41.             NEXT y
  42.         NEXT x
  43.         _DELAY .1
  44.     END IF
  45.     _DISPLAY
  46.  

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Happy Halloween!
« Reply #1 on: October 31, 2020, 05:06:18 pm »
Well, that's pretty slick.  Happy pumpkin.  We always gave our jack-o-lanterns a good smile growing up.

- Dav

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Happy Halloween!
« Reply #2 on: October 31, 2020, 05:07:27 pm »
LOL awesome, thanks Dav. :)

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Happy Halloween!
« Reply #3 on: October 31, 2020, 05:10:55 pm »
I just remembered that I never put a _LIMIT command on this so I checked my CPU usage on it and it's only around 2% or so! Did the last QB64 update reduce CPU usage on programs without _LIMIT ? Because stuff like this used to use about 10x as much it seems. Or maybe it's because this program is so small, I don't know?

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Happy Halloween!
« Reply #4 on: October 31, 2020, 05:49:23 pm »
You have a _delay in there that should help save the fan.

Here's mine: https://www.qb64.org/forum/index.php?topic=3196.msg124669#msg124669

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Happy Halloween!
« Reply #5 on: October 31, 2020, 06:03:43 pm »
Ahh yes I forgot about the delay slowing the CPU down. Yours looks wild. lol.