Hopefully this is another easy question. I'm still building my bat_and_ball game (see my post from yesterday) and I'm stuck again.
When my player fails to hit the ball back the ball goes out of play. The game plays a short piece of "you lost" music before restarting with a new ball. I want the game to pause for a few seconds while the music plays to give the player time to breathe, but at the moment it just plays the music and immediately restarts the game. Is there a simple way to tell my game to wait 5 seconds?
Here's the method:
and...
as you can see, I tried to use a For loop to count down the time (as I used to do in BASIC) but this doesn't work... (why doesn't it work? is it something to do with threads?)
I also tried this:
but when the ball went out it threw the error: "current
thread not owner"
Can anyone help me please?