'''Text (AKA Instructions)
GraphicsWindow.DrawText(5, 40, "You will be shown one rectangle. This tool will measure")
GraphicsWindow.DrawText(5, 60, "your response-time to it showing on screen. Try")
GraphicsWindow.DrawText(5, 80, "to click the left mouse button as soon as the rectangle")
GraphicsWindow.DrawText(5, 100, "appears.")
'''Addition to End button
GraphicsWindow.DrawText(150, 470, "Or you can")
'Button Click subroutine
Sub ButtonClicked
If Controls.LastClickedButton = Start Then
Game()
ElseIf Controls.LastClickedButton = End Then
Program.End()
ElseIf Controls.LastClickedButton = Again Then
Game()
EndIf
EndSub
'Tick Sub
Sub Tick
ElapsedTime = ElapsedTime+10
EndSub
'Mouse Click Event
Sub MouseDown
If Mouse.IsLeftButtonDown = "True" Then
Timer.Pause()
Program.Delay(500)
EndingScreen()
EndIf
EndSub
'Last screen of app
Sub EndingScreen
Response = ElapsedTime/100
GraphicsWindow.Clear()
GraphicsWindow.DrawText(10, 50, "Reponse Time: "+Response+" seconds.")
End = Controls.AddButton("End Application", 10, 200)
Controls.SetSize(End, 250, 40)