Public Sub GameOver
X2.SoundPool.PlaySound("lose")
GameOverState = True
Sleep(100)
ivMessages.SetBitmap(xui.LoadBitmap(File.DirAssets, "gameover.png"))
ivMessages.SetVisibleAnimated(1000, True)
Sleep(2000)
X2.Stop
X2.Reset
If B4XPages.GetManager.IsForeground Then
StartGame
End If
End Sub