Sub star
GraphicsWindow.BrushColor="Yellow"
GraphicsWindow.fillTriangle(145,60,135,80,155,80)
GraphicsWindow.FillTriangle(145,100,135,80,150,80)
GraphicsWindow.FillTriangle(125,80,145,70,145,90)
GraphicsWindow.FillTriangle(165,80,145,70,145,90)
EndSub
Sub Shapes_Init
' Shapes | Initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 988 ' x offset
shY = 488 ' y offset
shape = ""
shape[1] = "func=tri;x=153;y=41;x1=47;y1=0;x2=0;y2=22;x3=95;y3=22;bc=red;pw=0;beck"
shape[2] = "func=ell;x=118;y=0;width=91;height=73;bc=blue;pw=0;"
shape[3] = "func=line;x=172;y=36;x1=0;y1=0;x2=22;y2=0;pc=red;pw=2;blink"
shape[4] = "func=ell;x=172;y=25;width=22;height=22;bc=pink;pw=0;eye"
shape[5] = "func=tri;x=132;y=58;x1=31;y1=0;x2=0;y2=45;x3=62;y3=45;bc=red;pw=0;neck"
shape[6] = "func=tri;x=0;y=80;x1=37;y1=0;x2=0;y2=32;x3=75;y3=32;angle=178;bc=red;pw=0;tail"
shape[7] = "func=line;x=91;y=134;x1=0;y1=0;x2=0;y2=36;pc=red;pw=8;Leg1"
shape[8] = "func=ell;x=33;y=72;width=164;height=82;bc=yellow;pw=0;body"
shape[9] = "func=tri;x=58;y=180;x1=46;y1=0;x2=0;y2=14;x3=93;y3=14;bc=red;pw=0;Leg3"
shape[10] = "func=line;x=90;y=169;x1=0;y1=0;x2=14;y2=15;pc=yellow;pw=8;Leg2"
EndSub
Sub Shapes_Add
For i = 1 To Array.GetItemCount(shape)
GraphicsWindow.PenWidth = shape[i]["pw"]*s
GraphicsWindow.PenColor = shape[i]["pc"]
GraphicsWindow.BrushColor = shape[i]["bc"]
If shape[i]["func"] = "rect" Then
shape[i]["obj"] = Shapes.AddRectangle(shape[i]["width"]*s, shape[i]["height"]*s)
ElseIf shape[i]["func"] = "ell" Then
shape[i]["obj"] = Shapes.AddEllipse(shape[i]["width"]*s, shape[i]["height"]*s)
ElseIf shape[i]["func"] = "tri" Then
shape[i]["obj"] = Shapes.AddTriangle(shape[i]["x1"]*s, shape[i]["y1"]*s, shape[i]["x2"]*s, shape[i]["y2"]*s, shape[i]["x3"]*s, shape[i]["y3"]*s)
ElseIf shape[i]["func"] = "line" Then
shape[i]["obj"] = Shapes.AddLine(shape[i]["x1"]*s, shape[i]["y1"]*s, shape[i]["x2"]*s, shape[i]["y2"]*s)
EndIf
Shapes.Move(shape[i]["obj"], shX + shape[i]["x"]*s, shY + shape[i]["y"]*s)
Shapes.Rotate(shape[i]["obj"], shape[i]["angle"])
EndFor
EndSub
Shapes1_Init()
s = .3
Shapes1_Add()
Sub Shapes1_Init
' Shapes | Initialize shapes data
' return shX, shY - current position of shapes
' return shape - array of shapes
shX = 844 ' x offset
shY = 420 ' y offset
shape1 = ""
shape1[1] = "func=tri;x=153;y=41;x1=47;y1=0;x2=0;y2=22;x3=95;y3=22;bc=red;pw=0;beck"
shape1[2] = "func=ell;x=118;y=0;width=91;height=73;bc=blue;pw=0;"
shape1[3] = "func=line;x=172;y=36;x1=0;y1=0;x2=22;y2=0;pc=red;pw=2;blink"
shape1[4] = "func=ell;x=172;y=25;width=22;height=22;bc=pink;pw=0;eye"
shape1[5] = "func=tri;x=132;y=58;x1=31;y1=0;x2=0;y2=45;x3=62;y3=45;bc=red;pw=0;neck"
shape1[6] = "func=tri;x=0;y=80;x1=37;y1=0;x2=0;y2=32;x3=75;y3=32;angle=178;bc=red;pw=0;tail"
shape1[7] = "func=line;x=91;y=134;x1=0;y1=0;x2=0;y2=36;pc=red;pw=8;Leg1"
shape1[8] = "func=ell;x=33;y=72;width=164;height=82;bc=yellow;pw=0;body"
shape1[9] = "func=tri;x=58;y=180;x1=46;y1=0;x2=0;y2=14;x3=93;y3=14;bc=red;pw=0;Leg3"
shape1[10] = "func=line;x=90;y=169;x1=0;y1=0;x2=14;y2=15;pc=yellow;pw=8;Leg2"
EndSub
Sub Shapes1_Add
For i = 1 To Array.GetItemCount(shape1)
GraphicsWindow.PenWidth = shape1[i]["pw"]*s
GraphicsWindow.PenColor = shape1[i]["pc"]
GraphicsWindow.BrushColor = shape1[i]["bc"]
If shape1[i]["func"] = "rect" Then
shape1[i]["obj"] = Shapes.AddRectangle(shape1[i]["width"]*s, shape1[i]["height"]*s)
ElseIf shape[i]["func"] = "ell" Then
shape1[i]["obj"] = Shapes.AddEllipse(shape1[i]["width"]*s, shape1[i]["height"]*s)
ElseIf shape[i]["func"] = "tri" Then
shape1[i]["obj"] = Shapes.AddTriangle(shape1[i]["x1"]*s, shape1[i]["y1"]*s, shape1[i]["x2"]*s, shape1[i]["y2"]*s, shape1[i]["x3"]*s, shape1[i]["y3"]*s)
ElseIf shape[i]["func"] = "line" Then
shape1[i]["obj"] = Shapes.AddLine(shape1[i]["x1"]*s, shape1[i]["y1"]*s, shape1[i]["x2"]*s, shape1[i]["y2"]*s)
EndIf
Shapes.Move(shape1[i]["obj"], shX + shape1[i]["x"]*s, shY + shape1[i]["y"]*s)
Shapes.Rotate(shape1[i]["obj"], shape1[i]["angle"])
EndFor
EndSub
Snow()
Snowfalling()
Sub Snowfalling
For i=1 To 500
shapes.Animate(sSnow[i],Shapes.GetLeft(sSnow[i]),200+Math.GetRandomNumber(400),2000)
shapes.Animate(LSnow[i],Shapes.GetLeft(LSnow[i]),200+Math.GetRandomNumber(600),2000)
shapes.Animate(RSnow[i],Shapes.GetLeft(LSnow[i]),200+Math.GetRandomNumber(800),2000)
Program.Delay(200)
EndFor
EndSub
Sub Snow
GraphicsWindow.BrushColor="#E6EAE3"
For i=1 To 500
GraphicsWindow.FontSize=Math.GetRandomNumber(20)+2
sSnow[i]= Shapes.AddText("❅")
LSnow[i]= Shapes.AddText("❄")
RSnow[i]= Shapes.AddText("m")
shapes.Move(sSnow[i],Math.GetRandomNumber(1200),-100)
shapes.Move(LSnow[i],Math.GetRandomNumber(1200),-100)
shapes.Move(RSnow[i],Math.GetRandomNumber(1200),-100)
EndFor
EndSub