Games Delete map X2 Game Tiled

developer_123

Active Member
Licensed User
Longtime User
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?

I appreciate any information thank you!
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
X2.Stop
X2.Reset

From Clumsy Bird example:
B4X:
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
 

developer_123

Active Member
Licensed User
Longtime User
B4X:
X2.Stop
X2.Reset

From Clumsy Bird example:
B4X:
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
The lines x2.stop and x2.reset only let me or stop the game, or load again, but the map still appears. I need delete the map.
 
Top