If you have a While or Repeat inside a function, it will be stuck inside that function until the While or Repeat conditions are met. That's why you only get one thing running. I'm not sure what Timer() does in your program, I'm assuming something like this:
problem here is that the program remains in Timer() until the complete 30 seconds is up, not executing anything else.
If you use something like this, it'll work better:
My code is missing some elements like setting graphics mode and actually doing anything while the timer runs, just showing you the basic flow here.
Function Timer() time = Millisecs() While Millisecs() < time + 30000 ;wait 30 seconds Text 10,10,(Millisecs - time) Flip Wend Text 10,10,"Time's up!!!" End Function
problem here is that the program remains in Timer() until the complete 30 seconds is up, not executing anything else.
If you use something like this, it'll work better:
...some setup code Global time Global timeup = False ;main program time = Millisecs() While Not timeup Timer() ... Do other stuff Flip Wend Text 10,10,"Time's Up!!!!!!" ...Some other code Function Timer() If Millisec >= timer + 30000 Then timeup = True End Function
My code is missing some elements like setting graphics mode and actually doing anything while the timer runs, just showing you the basic flow here.