Hi folks, I have a simple Dice game program written in Small Basic. It can display a number of error messages, and plays an mp3 file for an error condition, or a different mp3 file when a winner is found.
A snippet of code follows. The problem is that while the text display is prior to the Sound.Play in the code, what actually happens is that the sound file is played before the text is displayed on the screen.
How can I fix this ?? Thanks for your help. Gordon H.
If ErrNo = 1 Then
GraphicsWindow.DrawText(x+nl1, y+10, " Must choose dice")
GraphicsWindow.DrawText(x+nl1, y+nl2, " before throwing ")
'....
ElseIf ErrNo = 99 Then
GraphicsWindow.DrawText(x+15, y+10, " This Player Wins")
GraphicsWindow.DrawText(x+10, y+nl2, " ******************")
GraphicsWindow.DrawText(x+nl1, y+nl1+nl2, " Reset All Players")
EndIf
'
ErrSound = FilePath + "\GameSoundErr.mp3"
WinSound = FilePath + "\GameSoundWin.mp3"
If ErrNo < 97 Then
Sound.PlayAndWait(ErrSound)
ElseIf ErrNo = 99 Then
Sound.PlayAndWait(WinSound)
EndIf