Microsoft Small Basic

Program Listing: GRT732
' Bowling Graphics
' Copyright © 2017 Nonki Takahashi. The MIT License.

GraphicsWindow.Title = "Bowling Graphics"
Init()

Sub Init
gw = 598
gh = 428
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
GraphicsWindow.BackgroundColor = "LightGray"
GraphicsWindow.BrushColor = "SaddleBrown"
GraphicsWindow.FillTriangle(gw / 2, 0, 0, gh, gw, gh)
GraphicsWindow.BrushColor = "LightGray"
GraphicsWindow.FillRectangle(0, 0, gw, 140)
GraphicsWindow.BrushColor = "GreenYellow"
GraphicsWindow.FillRectangle(0, 0, gw, 52)
GraphicsWindow.FillRectangle(0, 52, 149, 160)
GraphicsWindow.FillRectangle(gw - 149, 52, 149, 160)
path = "http://www.nonkit.com/smallbasic.files/Pin.png"
i = 0
GraphicsWindow.BrushColor = "Black"
For row = 4 To 1 Step -1
y = 100 - row * 10
For col = 1 To row
i = i + 1
pin[i] = Shapes.AddImage(path)
x = 249 + col * 60 - row * 30
Shapes.Move(pin[i], x, y)
EndFor
shadow = Shapes.AddRectangle(300, 160)
Shapes.SetOpacity(shadow, 10)
Shapes.Move(shadow, 149, 52)
EndFor
EndSub