E
E
Egor Bochkarev2019-09-04 16:13:12
Game development
Egor Bochkarev, 2019-09-04 16:13:12

How to restart a python game?

There is a code with a simple game, how can I make it so that after the player runs out of hp, start the program?
So far, I have managed to do this by calling a function inside the function itself, but then the previous function does not close .... Please help !! This is the final touch

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Stupenkov, 2019-09-04
@alexstup

calling a function in an infinite loop

D
dollar, 2019-09-04
@dollar

Let the player decide if he wants to play and how. To do this, show something like "Game Over" at the end and transfer the player to the main menu of the game. Do you have a main menu in your game? And there should already be an item "Start again".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question