In this game I am making I have a death screen were the player can choose either to retry the game, or exit. The player chooses by pressing either one or two. When the player exits, the game calls on an exit function, which works perfectly. But when the player wants to retry, the program calls on the function that creates the level, but instead of working, the game crashes, what is going wrong?
This is the StartLevel() Function:
And here is the DeathScreen() Function:
This is the StartLevel() Function:
Function StartLevel() While Not KeyHit(1) Cls DrawLevel() TestInput() TestEnemy() TestCollision() Timer() DrawHUD() Flip Wend End Function
And here is the DeathScreen() Function:
Function DeathScreen() While Not KeyHit(1) Cls Delete Player Delete Computer Delete Enemy Delete Enemy2 Text 260,240, "Game Over!" Text 263,275, "Continue?" Text 240,305, " Yes" Text 330,305, "No" If KeyHit(2) Then StartLevel() ElseIf KeyHit(3) Then EndScreen() End If Flip Wend End Function