Information Technology - Computer Programming - Source Code - Homebrew - Open Source - Software - Hardware - 8 bit - 16 bit - 32 bit - 64 bit - x86 - x64 - DOS - Windows - Linux - Arduino - Embedded - Development - Retro - Vintage - Math - Science - History - Hobby - Beginners - Professionals - Experiment - Research - Study - Fun - Games

Happy New Year!

Share your Craft Basic creations here.
Post Reply
User avatar
Beronica
Posts: 15
Joined: Wed Feb 22, 2023 8:19 am

Happy New Year!

Post by Beronica »

Wishing everyone a happy new year!
:D

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



User avatar
Brian
Posts: 15
Joined: Mon Dec 11, 2023 2:19 pm

Re: Happy New Year!

Post by Brian »

Hi Beronica,
Thank you for your 2024 wishes. I wish you, Gemino and all the visitors to this forum a Happy New Year filled with success, happiness and prosperity.
This video show’s London's spectacular fireworks display last night on the River Thames as Big Ben strikes midnight.


https://www.youtube.com/watch?v=r2wBcCIlMGw
User avatar
Beronica
Posts: 15
Joined: Wed Feb 22, 2023 8:19 am

Re: Happy New Year!

Post by Beronica »

Hello, Brian. Thank you for your best wishes. I hope your 2024 is prosperous as well.

Wow, that's an amazing display! I've never seen one like that.
Post Reply