Microsoft Small Basic

Program Listing: HMX882-0
' Chirstmas Tree
' Version 0.2
' Copyright © 2012-2018 Nonki Takahashi. The MIT License.
'
' History:
' 0.2 2018-12-17 Modified for 2019. (HMX882-0)
' 0.1 2012-12-11 Created. (HMX882)
' 0.0 2012-12-11 15:54:28 Generated by Shapes 1.5
'
GraphicsWindow.Title = "Merry Christmas and A Happy New Year 2019"
bg = "#222222"
GraphicsWindow.BackgroundColor = bg
gw = 598
gh = 428
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
SB_Workaround()
DrawStars()
' draw wall
GraphicsWindow.BrushColor = bg
GraphicsWindow.FillRectangle(270, 250, 110, 150)
' initialize shapes for Santa
Shapes_Init_Santa()
angle = 0
scale = 0.5
name = "Santa"
Group_Add()
' initialize shapes for Christmas tree
Shapes_Init_Tree()
scale = 0.4
name = "Tree"
Group_Add()
InitFlashLights()
' initialize shapes for house (and snowman)
Shapes_Init_House()
scale = 0.8
name = "House"
Group_Add()
eyes = "1=6;2=7;"
While "True"
_t = Math.Remainder(t, 200) ' 20 sec
If 130 < _t Then
i = 1 ' Santa
grp = group[i]
x = 500 - 15 * (_t - 130)
y = grp["y"]
Group_Move()
EndIf
_t = Math.Remainder(t, 30) ' 3 sec
If _t = 0 Then
pattern = Math.GetRandomNumber(3)
If pattern = 3 Then
GenerateRandomArray()
EndIf
i = 3 ' snowman (house)
grp = group[i]
shape = grp["shape"]
For i = 1 To 2
shp = shape[eyes[i]]
Shapes.ShowShape(shp["obj"])
EndFor
EndIf
If (0 <= _t) And (_t <= 25) Then
i = 2 ' tree
grp = group[i]
shape = grp["shape"]
If pattern = 1 Then
shp = shape[_t + fbegin]
ElseIf pattern = 2 Then
shp = shape[fend - _t]
ElseIf pattern = 3 Then
shp = shape[fbegin + ra[_t]]
EndIf
Shapes.SetOpacity(shp["obj"], 0) ' flash lights on
EndIf
If _t = 28 Then
i = 3 ' snowman (house)
grp = group[i]
shape = grp["shape"]
For i = 1 To 2
shp = shape[eyes[i]]
Shapes.HideShape(shp["obj"])
EndFor
EndIf
If _t = 29 Then
i = 2 ' tree
grp = group[i]
shape = grp["shape"]
For f = fbegin To fend
shp = shape[f]
Shapes.SetOpacity(shp["obj"], 70) ' flash lights off
EndFor
EndIf
Program.Delay(100)
t = t + 1
EndWhile

Sub DrawStars
GraphicsWindow.BrushColor = "White"
For i = 1 To 500
x = Math.GetRandomNumber(gw) - 1
y = Math.GetRandomNumber(gh) - 1
s = Math.GetRandomNumber(3)
GraphicsWindow.FillEllipse(x, y, s, s)
EndFor
EndSub

Sub GenerateRandomArray
ra[0] = 1
ra[1] = 0 ' end
n = 2
For i = 2 To 25
p = 0
o = Math.GetRandomNumber(n) - 1
While 0 < o
p = ra[p]
o = o - 1
EndWhile
ra[i] = ra[p]
ra[p] = i
n = n + 1
EndFor
EndSub

Sub InitFlashLights
fbegin = 48
fend = 73
For f = fbegin To fend
shp = shape[f]
Shapes.SetOpacity(shp["obj"], 70) ' flash lights off
EndFor
EndSub

Sub Group_Add
' Group | add shapes To a group
' param name - group name
' param shX, shY, origin of shape array
' param scale - scale of group
' param shape[] - shape array
' param nGroup - number of group
' return nGroup - updated number of group
' return group - group array
Stack.PushValue("local", i)
Stack.PushValue("local", x)
Stack.PushValue("local", y)
nGroup = nGroup + 1
grp = ""
grp["name"] = name
grp["x"] = shX
grp["y"] = shY
grp["angle"] = 0
grp["dir"] = 1
Shapes_CalcWidthAndHeight()
grp["width"] = shWidth
grp["height"] = shHeight
s = scale
grp["scale"] = s
For i = 1 To Array.GetItemCount(shape)
shp = shape[i]
GraphicsWindow.PenWidth = shp["pw"] * s
If shp["pw"] > 0 Then
GraphicsWindow.PenColor = shp["pc"]
EndIf
If Text.IsSubText("rect|ell|tri|text|btn", shp["func"]) Then
GraphicsWindow.BrushColor = shp["bc"]
EndIf
If Text.IsSubText("text|btn", shp["func"]) Then
If silverlight Then
fs = Math.Floor(shp["fs"] * 0.9)
Else
fs = shp["fs"]
EndIf
GraphicsWindow.FontSize = fs * s
GraphicsWindow.FontName = shp["fn"]
If shp["fb"] = "False" Then
GraphicsWindow.FontBold = "False"
Else
GraphicsWindow.FontBold = "True"
EndIf
EndIf
If shp["func"] = "rect" Then
shp["obj"] = Shapes.AddRectangle(shp["width"] * s, shp["height"] * s)
ElseIf shp["func"] = "ell" Then
shp["obj"] = Shapes.AddEllipse(shp["width"] * s, shp["height"] * s)
ElseIf shp["func"] = "tri" Then
shp["obj"] = Shapes.AddTriangle(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s, shp["x3"] * s, shp["y3"] * s)
shp["width"] = shp["x3"] - shp["x2"]
shp["height"] = shp["y2"] - shp["y1"]
ElseIf shp["func"] = "line" Then
shp["obj"] = Shapes.AddLine(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s)
shp["width"] = Math.Max(shp["x1"], shp["x2"]) - Math.Min(shp["x1"], shp["x2"])
shp["height"] = Math.Max(shp["y1"], shp["y2"]) - Math.Min(shp["y1"], shp["y2"])
ElseIf shp["func"] = "text" Then
shp["obj"] = Shapes.AddText(shp["text"])
shp["width"] = shp["fs"] * 0.6 * Text.GetLength(shp["text"])
shp["height"] = shp["fs"]
EndIf
param["x"] = shp["x"]
param["y"] = shp["y"]
param["cx"] = shWidth / 2
param["cy"] = shHeight / 2
param["width"] = shp["width"]
param["height"] = shp["height"]
param["scale"] = s
param["angle"] = 0
Shapes_CalcRotateZoomPos()
shp["rx"] = x
shp["ry"] = y
If silverlight And Text.IsSubText("tri|line", shp["func"]) Then
alpha = Math.GetRadians(shp["angle"])
SB_RotateWorkaround()
shp["wx"] = x
shp["wy"] = y
EndIf
If shp["func"] = "btn" Then
shp["obj"] = Controls.AddButton(shp["caption"], shX + x, shY + y)
Else
Shapes.Move(shp["obj"], shX + x, shY + y)
EndIf
If Text.IsSubText("rect|ell|tri|text", shp["func"]) And (shp["angle"] <> 0) And (shp["angle"] <> "") Then
Shapes.Rotate(shp["obj"], shp["angle"])
EndIf
shape[i] = shp
EndFor
grp["shape"] = shape
group[nGroup] = grp
y = Stack.PopValue("local")
x = Stack.PopValue("local")
i = Stack.PopValue("local")
EndSub

Sub Group_Move
' Group | Move a group
' param group[i] - group To move
' param x, y - position To move
' return group[i] - updated group
Stack.PushValue("local", j)
grp = group[i]
s = grp["scale"]
grp["x"] = x
grp["y"] = y
shape = grp["shape"]
n = Array.GetItemCount(shape)
For j = 1 To n
shp = shape[j]
If silverlight And Text.IsSubText("tri|line", shp["func"]) Then
_x = shp["wx"]
_y = shp["wy"]
Else
_x = shp["rx"]
_y = shp["ry"]
EndIf
Shapes.Move(shp["obj"], grp["x"] + _x, grp["y"] + _y)
EndFor
group[i] = grp
j = Stack.PopValue("local")
EndSub

Sub Group_Rotate
' Group | Rotate a group
' param group[i] - group To move
' param cx, cy - rotation center (If given)
' param angle - To rotate
Stack.PushValue("local", x)
Stack.PushValue("local", y)
Stack.PushValue("local", n)
grp = group[i]
shape = grp["shape"]
moved = "False"
If cx <> "" Then
moved = "True"
Else
cx = "" ' to avoid syntax error
EndIf
If cy <> "" Then
moved = "True"
Else
cy = "" ' to avoid syntax error
EndIf
If moved Then
param["x"] = grp["x"]
param["y"] = grp["y"]
param["cx"] = cx
param["cy"] = cy
param["width"] = grp["width"]
param["height"] = grp["height"]
param["scale"] = 1
param["angle"] = angle
Shapes_CalcRotateZoomPos()
grp["x"] = x
grp["y"] = y
EndIf
param["cx"] = grp["width"] / 2
param["cy"] = grp["height"] / 2
param["scale"] = grp["scale"]
grp["angle"] = grp["angle"] + angle
param["angle"] = grp["angle"]
n = Array.GetItemCount(shape)
Stack.PushValue("local", i)
For i = 1 To n
shp = shape[i]
param["x"] = shp["x"]
param["y"] = shp["y"]
param["width"] = shp["width"]
param["height"] = shp["height"]
Shapes_CalcRotateZoomPos()
shp["rx"] = x
shp["ry"] = y
If silverlight And Text.IsSubText("tri|line", shp["func"]) Then
alpha = Math.GetRadians(shp["angle"] + grp["angle"])
SB_RotateWorkAround()
shp["wx"] = x
shp["wy"] = y
EndIf
Shapes.Move(shp["obj"], grp["x"] + x, grp["y"] + y)
Shapes.Rotate(shp["obj"], shp["angle"] + grp["angle"])
shape[i] = shp
EndFor
i = Stack.PopValue("local")
grp["shape"] = shape
group[i] = grp
n = Stack.PopValue("local")
y = Stack.PopValue("local")
x = Stack.PopValue("local")
EndSub

Sub Math_CartesianToPolar
' Math | convert cartesian coodinate to polar coordinate
' param x, y - cartesian coordinate
' return r, a - polar coordinate
r = Math.SquareRoot(x * x + y * y)
If x = 0 And y > 0 Then
a = 90 ' [degree]
ElseIf x = 0 And y < 0 Then
a = -90
ElseIf x = 0 Then
a = 0
Else
a = Math.ArcTan(y / x) * 180 / Math.Pi
EndIf
If x < 0 Then
a = a + 180
ElseIf x > 0 And y < 0 Then
a = a + 360
EndIf
EndSub

Sub SB_RotateWorkaround
' Small Basic | rotate workaround for Silverlight
' param shp - current shape
' param x, y - original coordinate
' param alpha - angle [radian]
' returns x, y - workaround coordinate
If shp["func"] = "tri" Then
x1 = -Math.Floor(shp["x3"] / 2)
y1 = -Math.Floor(shp["y3"] / 2)
ElseIf shp["func"] = "line" Then
x1 = -Math.Floor(Math.Abs(shp["x1"] - shp["x2"]) / 2)
y1 = -Math.Floor(Math.Abs(shp["y1"] - shp["y2"]) / 2)
EndIf
ox = x - x1
oy = y - y1
x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox
y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy
EndSub

Sub SB_Workaround
' Small Basic | workaround for Silverlight
' returns silverlight - "True" if in remote
color = GraphicsWindow.GetPixel(0, 0)
If Text.GetLength(color) > 7 Then
silverlight = "True"
msWait = 300
Else
silverlight = "False"
EndIf
EndSub

Sub Shapes_CalcRotateZoomPos
' Shapes | calculate position for rotated and zoomed shape
' param["x"], param["y"] - position of a shape
' param["width"], param["height"] - size of a shape
' param ["cx"], param["cy"] - center of rotation
' param ["angle"] - rotate angle
' param ["scale"] - zoom scale
' return x, y - rotated position of a shape
_cx = param["x"] + param["width"] / 2
_cy = param["y"] + param["height"] / 2
x = _cx - param["cx"]
y = _cy - param["cy"]
Math_CartesianToPolar()
a = a + param["angle"]
x = r * Math.Cos(a * Math.Pi / 180) * param["scale"]
y = r * Math.Sin(a * Math.Pi / 180) * param["scale"]
_cx = x + param["cx"]
_cy = y + param["cy"]
x = _cx - param["width"] / 2 * param["scale"]
y = _cy - param["height"] / 2 * param["scale"]
EndSub

Sub Shapes_CalcWidthAndHeight
' Shapes | calculate total width and height of shapes
' param shape[] - shape array
' return shWidth, shHeight - total size of shapes
For i = 1 To Array.GetItemCount(shape)
shp = shape[i]
If shp["func"] = "tri" Or shp["func"] = "line" Then
xmin = shp["x1"]
xmax = shp["x1"]
ymin = shp["y1"]
ymax = shp["y1"]
If shp["x2"] < xmin Then
xmin = shp["x2"]
EndIf
If xmax < shp["x2"] Then
xmax = shp["x2"]
EndIf
If shp["y2"] < ymin Then
ymin = shp["y2"]
EndIf
If ymax < shp["y2"] Then
ymax = shp["y2"]
EndIf
If shp["func"] = "tri" Then
If shp["x3"] < xmin Then
xmin = shp["x3"]
EndIf
If xmax < shp["x3"] Then
xmax = shp["x3"]
EndIf
If shp["y3"] < ymin Then
ymin = shp["y3"]
EndIf
If ymax < shp["y3"] Then
ymax = shp["y3"]
EndIf
EndIf
shp["width"] = xmax - xmin
shp["height"] = ymax - ymin
EndIf
If i = 1 Then
shWidth = shp["x"] + shp["width"]
shHeight = shp["y"] + shp["height"]
Else
If shWidth < shp["x"] + shp["width"] Then
shWidth = shp["x"] + shp["width"]
EndIf
If shHeight < shp["y"] + shp["height"] Then
shHeight = shp["y"] + shp["height"]
EndIf
EndIf
shape[i] = shp
EndFor
EndSub

Sub Shapes_Init_House
' Shapes | initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = -10 ' x offset
shY = 50 ' y offset
shape = ""
shape[1] = "func=rect;x=463;y=327;width=38;height=15;angle=29;bc=#442200;pw=0;"
shape[2] = "func=ell;x=495;y=266;width=84;height=73;bc=#FFFFFF;pw=0;"
shape[3] = "func=ell;x=479;y=320;width=115;height=97;bc=#FFFFFF;pw=0;"
shape[4] = "func=rect;x=513;y=297;width=16;height=6;bc=#000000;pw=0;"
shape[5] = "func=rect;x=545;y=297;width=16;height=6;bc=#000000;pw=0;"
shape[6] = "func=ell;x=512;y=290;width=18;height=19;bc=#000000;pw=0;"
shape[7] = "func=ell;x=544;y=290;width=18;height=19;bc=#000000;pw=0;"
shape[8] = "func=rect;x=526;y=317;width=21;height=5;bc=#000000;pw=0;"
shape[9] = "func=rect;x=-80;y=380;width=758;height=78;bc=#FFFFFF;pw=0;"
shape[10] = "func=tri;x=30;y=50;x1=100;y1=0;x2=0;y2=150;x3=200;y3=150;bc=#999999;pw=0;"
shape[11] = "func=rect;x=30;y=200;width=200;height=200;bc=#999999;pw=0;"
shape[12] = "func=tri;x=130;y=50;x1=100;y1=0;x2=0;y2=150;x3=200;y3=150;angle=180;bc=#660000;pw=0;"
shape[13] = "func=rect;x=230;y=50;width=100;height=150;bc=#660000;pw=0;"
shape[14] = "func=tri;x=230;y=50;x1=100;y1=0;x2=0;y2=150;x3=200;y3=150;bc=#660000;pw=0;"
shape[15] = "func=rect;x=230;y=200;width=50;height=200;bc=#CCCCCC;pw=0;"
shape[16] = "func=rect;x=380;y=200;width=50;height=200;bc=#CCCCCC;pw=0;"
shape[17] = "func=rect;x=230;y=350;width=200;height=50;bc=#CCCCCC;pw=0;"
shape[18] = "func=rect;x=80;y=200;width=100;height=200;bc=#442200;pw=0;"
EndSub

Sub Shapes_Init_Tree
' Shapes | initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 210 ' x offset
shY = 170 ' y offset
shape = ""
shape[1] = "func=rect;x=44;y=247;width=84;height=24;bc=#661100;pw=0;"
shape[2] = "func=tri;x=50;y=270;x1=8;y1=0;x2=0;y2=58;x3=17;y3=58;angle=180;bc=#661100;pw=0;"
shape[3] = "func=tri;x=104;y=270;x1=8;y1=0;x2=0;y2=58;x3=17;y3=58;angle=180;bc=#661100;pw=0;"
shape[4] = "func=rect;x=59;y=270;width=54;height=58;bc=#661111;pw=0;"
shape[5] = "func=rect;x=44;y=270;width=84;height=5;bc=#66222222;pw=0;"
shape[6] = "func=rect;x=74;y=200;width=22;height=48;bc=#3B1E0C;pw=0;"
shape[7] = "func=tri;x=30;y=19;x1=54;y1=0;x2=0;y2=82;x3=109;y3=82;bc=#17330B;pw=0;"
shape[8] = "func=tri;x=16;y=49;x1=69;y1=0;x2=0;y2=98;x3=138;y3=98;bc=#17330B;pw=0;"
shape[9] = "func=tri;x=0;y=89;x1=84;y1=0;x2=0;y2=113;x3=168;y3=113;bc=#17330B;pw=0;"
shape[10] = "func=tri;x=61;y=0;x1=24;y1=0;x2=0;y2=14;x3=49;y3=14;angle=181;bc=#B5925E;pw=0;"
shape[11] = "func=tri;x=60;y=0;x1=24;y1=0;x2=0;y2=14;x3=49;y3=14;angle=252;bc=#B5925E;pw=0;"
shape[12] = "func=tri;x=59;y=0;x1=24;y1=0;x2=0;y2=14;x3=49;y3=14;angle=331;bc=#B5925E;pw=0;"
shape[13] = "func=rect;x=157;y=253;width=77;height=74;bc=#CC9999;pw=0;"
shape[14] = "func=rect;x=170;y=287;width=26;height=28;angle=20;bc=#669966;pw=0;"
shape[15] = "func=rect;x=171;y=263;width=17;height=18;angle=20;bc=#669966;pw=0;"
shape[16] = "func=rect;x=204;y=284;width=21;height=22;angle=20;bc=#669966;pw=0;"
shape[17] = "func=rect;x=187;y=236;width=16;height=91;bc=#990000;pw=0;"
shape[18] = "func=tri;x=164;y=227;x1=13;y1=0;x2=0;y2=20;x3=27;y3=20;bc=Transparent;pc=#990000;pw=8;"
shape[19] = "func=tri;x=200;y=227;x1=13;y1=0;x2=0;y2=20;x3=27;y3=20;bc=Transparent;pc=#990000;pw=8;"
shape[20] = "func=line;x=166;y=245;x1=26;y1=0;x2=0;y2=21;pc=#990000;pw=8;"
shape[21] = "func=line;x=197;y=245;x1=0;y1=0;x2=23;y2=23;pc=#990000;pw=8;"
' flashing lights start
shape[22] = "func=rect;x=100;y=57;width=8;height=8;bc=#0029CC;pw=0;"
shape[23] = "func=rect;x=91;y=68;width=9;height=9;bc=#0029CC;pw=0;"
shape[24] = "func=rect;x=78;y=75;width=10;height=8;bc=#0029CC;pw=0;"
shape[25] = "func=rect;x=67;y=82;width=10;height=9;bc=#0029CC;pw=0;"
shape[26] = "func=rect;x=52;y=86;width=10;height=10;bc=#0029CC;pw=0;"
shape[27] = "func=rect;x=39;y=86;width=10;height=8;bc=#0029CC;pw=0;"
shape[28] = "func=rect;x=121;y=83;width=10;height=10;bc=#0029CC;pw=0;"
shape[29] = "func=rect;x=114;y=95;width=9;height=9;bc=#0029CC;pw=0;"
shape[30] = "func=rect;x=102;y=106;width=8;height=9;bc=#0029CC;pw=0;"
shape[31] = "func=rect;x=92;y=117;width=10;height=8;bc=#0029CC;pw=0;"
shape[32] = "func=rect;x=82;y=125;width=8;height=10;bc=#0029CC;pw=0;"
shape[33] = "func=rect;x=71;y=133;width=8;height=10;bc=#0029CC;pw=0;"
shape[34] = "func=rect;x=57;y=138;width=10;height=10;bc=#0029CC;pw=0;"
shape[35] = "func=rect;x=43;y=138;width=10;height=10;bc=#0029CC;pw=0;"
shape[36] = "func=rect;x=31;y=137;width=8;height=9;bc=#0029CC;pw=0;"
shape[37] = "func=rect;x=26;y=127;width=10;height=8;bc=#0029CC;pw=0;"
shape[38] = "func=rect;x=134;y=126;width=8;height=10;bc=#0029CC;pw=0;"
shape[39] = "func=rect;x=125;y=135;width=8;height=10;bc=#0029CC;pw=0;"
shape[40] = "func=rect;x=115;y=145;width=8;height=10;bc=#0029CC;pw=0;"
shape[41] = "func=rect;x=105;y=154;width=9;height=10;bc=#0029CC;pw=0;"
shape[42] = "func=rect;x=93;y=163;width=10;height=10;bc=#0029CC;pw=0;"
shape[43] = "func=rect;x=80;y=170;width=10;height=10;bc=#0029CC;pw=0;"
shape[44] = "func=rect;x=66;y=174;width=10;height=9;bc=#0029CC;pw=0;"
shape[45] = "func=rect;x=51;y=176;width=9;height=9;bc=#0029CC;pw=0;"
shape[46] = "func=rect;x=37;y=175;width=8;height=9;bc=#0029CC;pw=0;"
shape[47] = "func=rect;x=22;y=173;width=10;height=10;bc=#0029CC;pw=0;"
' flashing lights end
' mask start
shape[48] = "func=rect;x=100;y=57;width=8;height=8;bc=#000000;pw=0;"
shape[49] = "func=rect;x=91;y=68;width=9;height=9;bc=#000000;pw=0;"
shape[50] = "func=rect;x=78;y=75;width=10;height=8;bc=#000000;pw=0;"
shape[51] = "func=rect;x=67;y=82;width=10;height=9;bc=#000000;pw=0;"
shape[52] = "func=rect;x=52;y=86;width=10;height=10;bc=#000000;pw=0;"
shape[53] = "func=rect;x=39;y=86;width=10;height=8;bc=#000000;pw=0;"
shape[54] = "func=rect;x=121;y=83;width=10;height=10;bc=#000000;pw=0;"
shape[55] = "func=rect;x=114;y=95;width=9;height=9;bc=#000000;pw=0;"
shape[56] = "func=rect;x=102;y=106;width=8;height=9;bc=#000000;pw=0;"
shape[57] = "func=rect;x=92;y=117;width=10;height=8;bc=#000000;pw=0;"
shape[58] = "func=rect;x=82;y=125;width=8;height=10;bc=#000000;pw=0;"
shape[59] = "func=rect;x=71;y=133;width=8;height=10;bc=#000000;pw=0;"
shape[60] = "func=rect;x=57;y=138;width=10;height=10;bc=#000000;pw=0;"
shape[61] = "func=rect;x=43;y=138;width=10;height=10;bc=#000000;pw=0;"
shape[62] = "func=rect;x=31;y=137;width=8;height=9;bc=#000000;pw=0;"
shape[63] = "func=rect;x=26;y=127;width=10;height=8;bc=#000000;pw=0;"
shape[64] = "func=rect;x=134;y=126;width=8;height=10;bc=#000000;pw=0;"
shape[65] = "func=rect;x=125;y=135;width=8;height=10;bc=#000000;pw=0;"
shape[66] = "func=rect;x=115;y=145;width=8;height=10;bc=#000000;pw=0;"
shape[67] = "func=rect;x=105;y=154;width=9;height=10;bc=#000000;pw=0;"
shape[68] = "func=rect;x=93;y=163;width=10;height=10;bc=#000000;pw=0;"
shape[69] = "func=rect;x=80;y=170;width=10;height=10;bc=#000000;pw=0;"
shape[70] = "func=rect;x=66;y=174;width=10;height=9;bc=#000000;pw=0;"
shape[71] = "func=rect;x=51;y=176;width=9;height=9;bc=#000000;pw=0;"
shape[72] = "func=rect;x=37;y=175;width=8;height=9;bc=#000000;pw=0;"
shape[73] = "func=rect;x=22;y=173;width=10;height=10;bc=#000000;pw=0;"
' mask end
shape[74] = "func=ell;x=79;y=185;width=23;height=24;bc=#969696;pw=0;"
shape[75] = "func=ell;x=93;y=126;width=23;height=24;bc=#969696;pw=0;"
shape[76] = "func=ell;x=41;y=149;width=23;height=24;bc=#969696;pw=0;"
shape[77] = "func=ell;x=41;y=101;width=23;height=24;bc=#969696;pw=0;"
shape[78] = "func=ell;x=138;y=138;width=23;height=24;bc=#969696;pw=0;"
shape[79] = "func=ell;x=57;y=41;width=23;height=24;bc=#B5925E;pw=0;"
shape[80] = "func=ell;x=80;y=88;width=23;height=24;bc=#B5925E;pw=0;"
shape[81] = "func=ell;x=20;y=191;width=23;height=24;bc=#B5925E;pw=0;"
shape[82] = "func=ell;x=124;y=176;width=23;height=24;bc=#B5925E;pw=0;"
EndSub

Sub Shapes_Init_Santa
' Shapes | initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 500 ' x offset
shY = -40 ' y offset
shape = ""
shape[1] = "func=ell;x=35;y=114;width=104;height=50;bc=#814A27;pw=0;"
shape[2] = "func=rect;x=44;y=150;width=9;height=65;bc=#814A27;pw=0;"
shape[3] = "func=rect;x=57;y=150;width=9;height=65;bc=#814A27;pw=0;"
shape[4] = "func=rect;x=107;y=150;width=9;height=65;bc=#814A27;pw=0;"
shape[5] = "func=rect;x=121;y=150;width=9;height=65;bc=#814A27;pw=0;"
shape[6] = "func=rect;x=40;y=85;width=24;height=47;bc=#814A27;pw=0;"
shape[7] = "func=ell;x=131;y=116;width=18;height=20;bc=#814A27;pw=0;"
shape[8] = "func=rect;x=51;y=43;width=7;height=30;bc=#A7842A;pw=0;"
shape[9] = "func=rect;x=61;y=50;width=7;height=30;bc=#A7842A;pw=0;"
shape[10] = "func=rect;x=41;y=26;width=7;height=30;angle=297;bc=#A7842A;pw=0;"
shape[11] = "func=rect;x=71;y=30;width=7;height=30;angle=55;bc=#A7842A;pw=0;"
shape[12] = "func=rect;x=29;y=6;width=7;height=30;angle=352;bc=#A7842A;pw=0;"
shape[13] = "func=rect;x=83;y=10;width=7;height=30;angle=7;bc=#A7842A;pw=0;"
shape[14] = "func=rect;x=38;y=116;width=27;height=7;angle=349;bc=#000000;pw=0;"
shape[15] = "func=ell;x=28;y=117;width=16;height=16;bc=#C3AB6F;pw=0;"
shape[16] = "func=rect;x=165;y=205;width=241;height=9;bc=#8C8C8C;pw=0;"
shape[17] = "func=rect;x=185;y=185;width=9;height=23;bc=#8C8C8C;pw=0;"
shape[18] = "func=rect;x=377;y=185;width=9;height=23;bc=#8C8C8C;pw=0;"
shape[19] = "func=rect;x=156;y=191;width=9;height=23;angle=317;bc=#8C8C8C;pw=0;"
shape[20] = "func=rect;x=69;y=114;width=9;height=52;angle=355;bc=#000000;pw=0;"
shape[21] = "func=rect;x=73;y=143;width=111;height=9;bc=#000000;pw=0;"
shape[22] = "func=ell;x=299;y=75;width=92;height=88;bc=#EBE4D0;pw=0;"
shape[23] = "func=ell;x=239;y=87;width=84;height=88;bc=#9D1010;pw=0;"
shape[24] = "func=ell;x=258;y=51;width=49;height=57;bc=#EBE4D0;pw=0;"
shape[25] = "func=rect;x=266;y=66;width=33;height=21;bc=#DBB9A9;pw=0;"
shape[26] = "func=ell;x=275;y=79;width=13;height=13;bc=#9D1010;pw=0;"
shape[27] = "func=rect;x=271;y=47;width=32;height=14;angle=13;bc=#9D1010;pw=0;"
shape[28] = "func=rect;x=274;y=43;width=36;height=13;bc=#9D1010;pw=0;"
shape[29] = "func=ell;x=306;y=37;width=18;height=20;bc=#EBE4D0;pw=0;"
shape[30] = "func=rect;x=264;y=89;width=10;height=45;angle=333;bc=#E2D8BB;pw=0;"
shape[31] = "func=rect;x=283;y=89;width=10;height=63;angle=33;bc=#EBE4D0;pw=0;"
shape[32] = "func=rect;x=184;y=143;width=202;height=43;bc=#563A1A;pw=0;"
shape[33] = "func=ell;x=210;y=65;width=24;height=24;bc=#EBE4D0;pw=0;"
shape[34] = "func=rect;x=215;y=83;width=26;height=34;angle=347;bc=#9D1010;pw=0;"
shape[35] = "func=rect;x=225;y=90;width=26;height=34;angle=272;bc=#9D1010;pw=0;"
shape[36] = "func=ell;x=16;y=71;width=56;height=30;bc=#814A27;pw=0;"
shape[37] = "func=ell;x=41;y=75;width=12;height=12;bc=#000000;pw=0;"
shape[38] = "func=ell;x=7;y=79;width=14;height=14;bc=#9D1010;pw=0;"
shape[39] = "func=ell;x=64;y=72;width=24;height=12;angle=340;bc=#814A27;pw=0;"
shape[40] = "func=rect;x=259;y=71;width=17;height=4;angle=350;bc=#EBE4D0;pw=;"
shape[41] = "func=rect;x=288;y=71;width=17;height=4;angle=18;bc=#EBE4D0;pw=;"
shape[42] = "func=rect;x=98;y=19;width=7;height=30;angle=81;bc=#A7842A;pw=0;"
shape[43] = "func=rect;x=17;y=16;width=7;height=30;angle=287;bc=#A7842A;pw=0;"
shape[44] = "func=rect;x=115;y=5;width=7;height=30;angle=16;bc=#A7842A;pw=0;"
shape[45] = "func=rect;x=0;y=0;width=7;height=30;angle=338;bc=#A7842A;pw=0;"
shape[46] = "func=ell;x=289;y=81;width=21;height=22;bc=#EBE4D0;pw=0;"
shape[47] = "func=ell;x=255;y=83;width=21;height=22;bc=#EBE4D0;pw=0;"
shape[48] = "func=ell;x=265;y=71;width=14;height=14;bc=#FFFFFF;pc=#000000;pw=2;"
shape[49] = "func=ell;x=285;y=71;width=14;height=14;bc=#FFFFFF;pc=#000000;pw=2;"
shape[50] = "func=line;x=277;y=77;x1=0;y1=0;x2=10;y2=0;pc=#000000;pw=2;"
EndSub