Another Cristmas Tree.
This is DBC 1.13 version using memblock to make music
Some troubles are possible with improper fonts
Tested in Windows 98 and Windows XP
` start and arrays
sync on:disable escapekey:set display mode 800,600,16:sync rate 50:hide mouse:sync:dim ang#(300):dim r#(300):dim z#(300):dim v#(300):dim pz#(15):dim pv#(15):g#=-.002
` make music
dim s#(100):s#(1) = 4.0: k# = 1.06: FOR i = 2 TO 84: s#(i) = s#(i - 1) * k#: NEXT i:make memblock 1,1320012:write memblock dword 1,0,16:write memblock dword 1,4,22050:write memblock dword 1,8,1
p=12:read muz$:amp#=0:for q=1 to 113:fi=asc(mid$(muz$,q+q-1))-4:ti=(asc(mid$(muz$,q+q))-64)*120:f#=0:if fi<118:f#=s#(fi-48):endif:for i=1 to 22*ti:if i<1000:amp#=amp#+6*(amp#<24000):endif:if i>2000:amp#=amp#*.9997:endif
v=amp#*sin(f#*i)+.5*amp#*sin(2*f#*i):if v<0:v=v+65536:endif:write memblock word 1,p,v:p=p+2:next i:next q:make sound from memblock 1,1:loop sound 1
` jingle bells (note-time, z - pause)
data "KBKBKDKBKBKDKBNBGBIBKDzDLBLBLCLALBKBKBKAKAKBIBIBKBIDNBzBKBKBKDKBKBKDKBNBGBIBKDzDLBLBLCLALBKBKBKAKANBNBLBIBGDzBGBGBPBNBLBGDzBGBGBPBNBLBIDzBIBIBQBPBNBSBSBSBSASAUBSBQBNBLDGBGBPBNBLBGDzBGBGBPBNBLBIDzBIBIBQBPBNBSBSBSBSASAUBSBQBNBLD"
` snow texture
create bitmap 1,64,64:set current bitmap 1:ink rgb(64,255,255),0:set text font "windings",2:set text size 64:center text 32,0,"T":blur bitmap 1,3:get image 2,0,0,64,64
` star texture
ink rgb(255,64,64),0:x=171:for i=5 to 6:cls:center text 32,0,chr$(x):blur bitmap 1,3:get image i,0,0,64,64:ink rgb(255,255,0),0:x=181:next i
` green lines
ink rgb(64,255,64),0:create bitmap 1,128,128:set current bitmap 1:c=0:for i=0 to 31:for j=0 to 1:line 0,c,127,c:c=c+1:next j:c=c+2:next i:blur bitmap 1,1:get image 1,0,0,128,128
` people texture
set text font "webdings",2:set text size 128:ink rgb(255,255,255),0:for i=0 to 3:cls:center text 32,0,chr$(128+i):blur bitmap 1,3:get image 10+i,0,0,128,128:next i:set current bitmap 0
` make star
for i=5 to 6:make object plain i,1.6,1.6:ghost object on i:set object i,1,1,0:texture object i,i:position object i,0,4,0:next i
` make people
for i=0 to 15:make object plain 10+i,2,2:ghost object on 10+i:texture object 10+i,10+rnd(3):pa=45*i:pz#(i)=(5+rnd(5))/10.0:pv#(i)=0:position object 10+i,(2+(i>7))*cos(pa),pz#(i),(2+(i>7))*sin(pa):next i
` make snow
for i=101 to 299:make object plain i,1,1:ghost object on i:texture object i,2:ang#(i)=rnd(360):r#(i)=9+rnd(1000)/200.0:z#(i)=rnd(1000)/100.0:v#(i)=(3+rnd(3))/100.0:next i
` make tree
for i=1 to 3:make object cone i,i:texture object i,1:ghost object on i:position object i,0,4-i,0:next i
a=0:autocam off:color backdrop 0
` main loop animate snow
do:a=wrapvalue(a+1):position camera 6*sin(a),1,2*cos(a)-7:point camera 0,2,0:for i=101 to 299:if keystate(i-100):stop sound 1:end:endif:ang#(i)=wrapvalue(ang#(i)+1)
position object i,r#(i)*cos(ang#(i)),z#(i),r#(i)*sin(ang#(i)):z#(i)=z#(i)-v#(i):if z#(i)<-10:ang#(i)=rnd(360):r#(i)=2+rnd(1000)/200.0:z#(i)=z#(i)+20:v#(i)=(3+rnd(3))/100.0:endif:next i
` animate people
for i=0 to 15:pa=45*i:pv#(i)=pv#(i)+g#:pz#(i)=pz#(i)+pv#(i):if pz#(i)<0:pv#(i)=0-pv#(i):pz#(i)=pz#(i)+pv#(i):endif:position object 10+i,(2+(i>7))*cos(pa),pz#(i),(2+(i>7))*sin(pa):next i:sync:loop