Code: Select all
rem By Bero and Gemino Smothers
rem made for Craft Basic
rem Happy New Year 2023-2024
precision 8
define windowx = 640, windowy = 480
define textx = 250, texty = 280, textw = 150, texth = 20
title "Happy New Year!"
resize 0, 0, windowx, windowy
center
bgcolor 0, 0, 0
cls graphics
fill on
formid 1
formtext "Happy New Year!"
staticform textx, texty, textw, texth
fgcolor 255, 255, 0
colorform
updateform
wait
do
cls
wait
fgcolor 0, 160, 0
rect 0, windowy - 80, windowx, windowy - 400
gosub drawfirework
wait
loop k <> 1
cls
end
sub drawfirework
let radius = 8
let centerx = int(rnd * (windowx - 80)) + 40
let centery = int(rnd * (windowy - 180)) + 30
let rocketx = centerx
let tail = 10
for rockety = windowy - 80 to centery step -1
fgcolor tail, tail, tail
dot rocketx, rockety
wait
if tail < 255 then
let tail = tail + 1
endif
next rockety
let yellow = 20
for i = 0 to 5
let radians = .0174533
let radian = 0
let degree = 0
let cosv = 0
let sinv = 0
let plotx = 0
let ploty = 0
let index = 0
do
gosub plot
let degree = degree + 45
fgcolor yellow, yellow, 0
oval plotx, ploty, 3, 3
let lastx = plotx
let lasty = ploty
button k, 27
wait
loop degree < 360 and k <> 1
if k = 1 then
break i
endif
let radius = radius + 8
let yellow = yellow + 40
fgcolor 0, 160, 0
rect 0, windowy - 80, windowx, windowy - 400
next i
return
sub plot
let radian = degree * radians
let plotx = centerx + radius * cos(radian)
let ploty = centery - radius * sin(radian)
return