Trying Again

Add a way for the player to restart the game when they win or lose.

Add the following else condition to the _update function.

 
else
if (btnp(X)) extcmd("reset")
 

Add the following code to the draw_win_lose function

 
print("press X to play again",20,72,5)
 

End Result

Save your changes with ctrl+S. Run them with ctrl+R. You should now be able to have reset the game after winning or losing.

Congratualations! This marks the point where you have a fully functional game!

You have an interactive world with a goal, obstacles to achieving that goal, the ability for the player to win or lose, and the ability to reset the game after a game over event.

Next, we will add text to the world to enable you to provide the player more guidance on what to do in the game.

Download