In my Game when I need to leave one level to go to another, I need to delete the map created using X2 with Tiled and delet all its bodies. How do I accomplish this with an instruction? Is it necessary to carry out a tour of all the bodies or is there a single instruction that eliminates everything?
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
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