06-27-2024, 09:16 AM
ZS,
Nice try!
Below is your main UI thread code - I always put this at the top of a program.
Everything else is subroutines, including events. Note that you only call StartGame 2 times. In the meantime within the 5 second pause the events do various stuff. As an event program gets more complex it will be harder to debug; this is why I always recommend the event loop with small delay handling flags set in event subs.
You can use Timer methods Pause and Resume, but trying to do it this way will get complex and very hard to understand - a fun project though
Nice try!
Below is your main UI thread code - I always put this at the top of a program.
Code:
GraphicsWindow.BackgroundColor = "White"
GraphicsWindow.FontSize = 40
StartGame()
'Restart Program
Program.Delay(5000)
GraphicsWindow.Clear()
'Timer Should Stop Here But There Is No Such Function In SB To Stop Timer
StartGame()
Everything else is subroutines, including events. Note that you only call StartGame 2 times. In the meantime within the 5 second pause the events do various stuff. As an event program gets more complex it will be harder to debug; this is why I always recommend the event loop with small delay handling flags set in event subs.
You can use Timer methods Pause and Resume, but trying to do it this way will get complex and very hard to understand - a fun project though