Microsoft Small Basic

Program Listing: WSF598
'___________________________________________
'CLICK THE BUTTON GAME
'MADE BY ROEMERBOY
'ALL RIGHTS RESERVED
'ENJOY IT!
'___________________________________________
Start()
Controls.ButtonClicked = OnButtonClicked
Timer.Tick = Timer1
Sub Start
GraphicsWindow.Title = "CLICK THE BUTTON"
GraphicsWindow.Height = 780
GraphicsWindow.Width = 1280
GraphicsWindow.CanResize = 1
GraphicsWindow.FontName = "Arial"
GraphicsWindow.FontBold = 0
Level1()
EndSub
Sub Level1
a = 0
P1 = Math.GetRandomNumber(1280)
P2 = Math.GetRandomNumber(780)
GraphicsWindow.BrushColor = "Black"
GraphicsWindow.FontSize = 20
GraphicsWindow.BackgroundColor = "Red"
Level1B = Controls.AddButton("CLICK ME!!!!!!!!!", P1, P2)
Controls.SetSize(Level1B, 200, 60)
Move1()
EndSub
Sub Level2
a = 1
P1 = Math.GetRandomNumber(1280)
P2 = Math.GetRandomNumber(780)
GraphicsWindow.BrushColor = "Magenta"
Controls.HideControl(Level1B)
GraphicsWindow.FontSize = 10
GraphicsWindow.BackgroundColor = "Blue"
Level2B = Controls.AddButton("CLICK ME!!!!!!!!!", P1, P2)
Controls.SetSize(Level2B, 100, 30)
Move2()
EndSub
Sub Level3
a = 2
P1 = Math.GetRandomNumber(1280)
P2 = Math.GetRandomNumber(780)
GraphicsWindow.BrushColor = "Brown"
Controls.HideControl(Level2B)
GraphicsWindow.FontSize = 5
GraphicsWindow.BackgroundColor = "Green"
Level3B = Controls.AddButton("CLICK ME!!!!!!!!!", P1, P2)
Controls.SetSize(Level3B, 50, 15)
Move3()
EndSub
Sub Level4
a = 3
P1 = Math.GetRandomNumber(1280)
P2 = Math.GetRandomNumber(780)
GraphicsWindow.BrushColor = "Black"
Controls.HideControl(Level3B)
GraphicsWindow.FontSize = 4
GraphicsWindow.BackgroundColor = "Gray"
Level4B = Controls.AddButton("CLICK ME!!!!!!!!!", P1, P2)
Controls.SetSize(Level4B, 25, 10)
Move4()
EndSub
Sub Move1
x = Math.GetRandomNumber(1280)
y = Math.GetRandomNumber(780)
Shapes.Animate(Level1B, x, y, 9000)
Timer.Interval = 9010
EndSub
Sub Move2
x = Math.GetRandomNumber(1280)
y = Math.GetRandomNumber(780)
Shapes.Animate(Level2B, x, y, 5000)
Timer.Interval = 5010
EndSub
Sub Move3
x = Math.GetRandomNumber(1280)
y = Math.GetRandomNumber(780)
Shapes.Animate(Level3B, x, y, 1200)
Timer.Interval = 1210
EndSub
Sub Move4
x = Math.GetRandomNumber(1280)
y = Math.GetRandomNumber(780)
Shapes.Animate(Level4B, x, y, 500)
Timer.Interval = 510
EndSub
Sub Timer1
If (a = 0) Then
r = Math.GetRandomNumber(1280)
s = Math.GetRandomNumber(780)
Shapes.Animate(Level1B, r, s, 10000)
ElseIf (a = 1) Then
r = Math.GetRandomNumber(1280)
s = Math.GetRandomNumber(780)
Shapes.Animate(Level2B, r, s, 5010)
ElseIf (a = 2) Then
r = Math.GetRandomNumber(1280)
s = Math.GetRandomNumber(780)
Shapes.Animate(Level3B, r, s, 1210)
ElseIf (a = 3) Then
r = Math.GetRandomNumber(1280)
s = Math.GetRandomNumber(780)
Shapes.Animate(Level4B, r, s, 510)
EndIf
Endsub
Sub OnButtonClicked
LastButton = Controls.LastClickedButton
If (LastButton = Level1B) Then
Sound.PlayBellRing()
GraphicsWindow.ShowMessage("You clicked the first Button! Now you can go to level two. Good luck!", "Second Level")
Level2()
ElseIf (LastButton = Level2B) Then
Sound.PlayBellRing()
GraphicsWindow.ShowMessage("You clicked the second Button! Wow. But the next level will be much harder!", "Third Level")
Level3()
ElseIf (LastButton = Level3B) Then
Sound.PlayBellRing()
GraphicsWindow.ShowMessage("You clicked the third Button! But the next level is to hard for you I think. Hehehe", "Fourth Level")
Level4()
ElseIf (LastButton = Level4B) Then
Sound.PlayBellRing()
GraphicsWindow.ShowMessage("Wow! I thought, you can't do this level.... Congratulations! You are the lucky winner. :D", "O.O You won!")
Program.End()
EndIf
EndSub