'=================
'CHRISTMAS2020.bas
'=================
'Christmas card to the QB64 community.
'Coded by Dav, DEC/2020
'Shows a liite snow, santa, tree, present, animation, music.
'Merry Christmas.
wht&
= _RGB(255, 255, 255) 'white color
'====== draw white color outlines first ...
'Draw tree star
CLINE ("199129209145214126234126219113232095211101201083196102176102192117180134199129")
'Draw the tree
CLINE ("199129175168190168156210168210142237160237129276141276110312132312102348120348")
CLINE ("120348093385108394136399172402242402283399316393327387300348312348284311309311")
CLINE ("309311276275289275258236272236246209259209224168239168214126")
CLINE ("173402181435234435242402")
'Draw fireplace
CLINE ("613328613275618272618268613269613215607209612206613199")
CLINE ("467345489346493206529188582188627204627344649344")
CLINE ("507327506276503274506270505216514207513196")
CLINE ("448340418358417364692364692359669342")
CLINE ("490345508328613328626345")
LINE (422, 105)-(697, 166), wht&
, B:
LINE (449, 166)-(466, 344), wht&
, B
LINE (648, 166)-(669, 345), wht&
, B:
LINE (481, 0)-(481, 104), wht&
LINE (631, 0)-(631, 104), wht&
'draw santa
CLINE ("514208540214560217583215603211611207613199")
CLINE ("524210524252539257561218580254594251598230595213")
CLINE ("582254591271591275589275590280593284599282598278606278613274")
CLINE ("539258529275529278531280530283523284522280514282506276")
CLINE ("529189556195569194587190")
CLINE ("594251598270613269")
CLINE ("526253523272506270")
'draw window
CLINE ("000104157104157000"): CLINE ("000093146093146000")
CLINE ("035093035028146028"): CLINE ("028093028028000028")
CLINE ("000022028022028000"): CLINE ("035000035022146022")
'draw present
CLINE ("412428388416375425383446402446425434459438452407422425421422412428")
CLINE ("377432353433352451421470488451487435420448403446391446")
CLINE ("419448422469420515359492358452"): CLINE ("420437447444470439459438")
CLINE ("470439469456454460455442"): CLINE ("386433395430404433")
CLINE ("458433487436467440")
LINE (412, 428)-(416, 438), wht&:
LINE (421, 424)-(424, 434), wht&
LINE (427, 430)-(443, 423), wht&:
LINE (352, 434)-(380, 440), wht&
LINE (373, 440)-(372, 456), wht&:
LINE (392, 446)-(392, 461), wht&
LINE (450, 461)-(450, 504), wht&:
LINE (463, 458)-(463, 499), wht&
LINE (420, 516)-(482, 491), wht&:
LINE (482, 491)-(481, 452), wht&
LINE (378, 458)-(378, 500), wht&:
LINE (395, 462)-(394, 505), wht&
'draw walls (left side)
LINE (0, 190)-(173, 190), wht&:
LINE (244, 190)-(449, 190), wht&
LINE (0, 206)-(159, 206), wht&:
LINE (257, 206)-(449, 206), wht&
LINE (0, 338)-(109, 338), wht&:
LINE (305, 338)-(449, 338), wht&
'draw walls (right side)
CLINE ("669192805192867229"): CLINE ("669209805209867244")
CLINE
("669341806341867390"):
LINE (805, 0)-(805, 341), wht&
'======= Paint in the colors....
CPAINT
("371435362445366469424443407455408491441454438484371435466436478446473471"), _RGB(31, 255, 31)CPAINT
("400436420430440430380450446440460450385475455475"), _RGB(255, 0, 0)CPAINT
("750260380240060240660222543118455183"), _RGB(76, 109, 138)CPAINT
("525056638214600345153019033026"), _RGB(40, 57, 72)CPAINT
("707075499209620246297077"), _RGB(67, 87, 123)CPAINT
("569192537226582236"), _RGB(205, 4, 23)CPAINT
("515235557278603253"), _RGB(80, 120, 153)CPAINT
("786202092198322199"), _RGB(83, 120, 153)CPAINT
("827217842226"), _RGB(74, 107, 136)PAINT (567, 206), wht&
, wht&
'draw santas thought box
LINE (657, 20)-(790, 70), wht&
, BF
LINE (637, 100)-(680, 70), wht&
LINE (637, 100)-(734, 70), wht&
PAINT (680, 77), wht&
, wht&
'=====================================================
'Play We wish you a Merry Christmas song...
Music$ = "mbt160o2g4o3c4c8d8c8o2b8a4a4a4o3d4d8e8d8c8o2b4g4g4o3e4e8f8"
Music$ = Music$ + "e8d8c4o2a4g8g8a4o3d4o2b4o3c2o2g4o3c4c4c4o2b2b4o3"
Music$ = Music$ + "c4o2b4a4g2o3d4e4d4c4o3g4o2g4g8g8a4o3d4o2b4o3c2"
Music$ = Music$ + "o2g4o3c4c8d8c8o2b8a4a4a4o3d4d8e8d8c8o2b4g4g4"
Music$ = Music$ + "o3e4e8f8e8d8c4o2a4g8g8a4o3d4o2b4o3c2"
'Show until keypress
'======================================================================
'======
ANIMATE:
'======
'show a little snow in window frames
SNOW 0, 0, 27, 20 'top left frame
SNOW 36, 0, 145, 20 'top right frame
SNOW 0, 29, 27, 90 'bottom left
SNOW 36, 29, 145, 91 'bottom right
'Draw/color ornaments
CCIRCLE ("198157051981871123019805191224062302230717126011")
CCIRCLE ("217250082562550515430209195295122282900425427806")
CCIRCLE ("256303051493390718033008209321092433451528032906")
CCIRCLE ("1543751319136804230383062863630927838707")
'blink a message
'==========================================================================
'draws continuious white line based on string of x/y cordinates
'(yes, I could have used DRAW instead, but wanted to roll my own...)
'set first line draw position
LINE (VAL(MID$(a$
, 1, 3)), VAL(MID$(a$
, 4, 3)))-(VAL(MID$(a$
, 7, 3)), VAL(MID$(a$
, 10, 3))), wht&
'continue based on last line position
'paints string of cordinates with color, stops at wht& color
'Draw circles based on string of x/y/r data, colors it too
clr&
= INT(RND * 5) + 1 'pick from 5 random colors IF clr&
= 1 THEN clr&
= _RGB(128, 255, 255) 'almost white IF clr&
= 2 THEN clr&
= _RGB(255, 255, 69) 'yellow
SUB SNOW
(x1
, y1
, x2
, y2
) 'random snow pattern in given window
LINE (x1
, y1
)-(x2
, y2
), _RGB(0, 0, 0), BF
'snow plow