[Python] How to ask player if they would like to retry when they die and if they say yes then...

Discussão em 'Python' iniciado por Stack, Outubro 2, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to add a function that asks the player If they want to restart and If they type yes, then the game should restart.

    elif response_turn3 == "right":
    print("You carry on down the path, whistling a merry tune.")
    time.sleep(4)
    print("Suddenly, a flash flood sweeps you away, freezing you to death in the cold, icy water.GAME OVER :(")
    print("Try again?")


    Then it would be something like

    (if yes then restart)


    How would this work in code?

    In order to do this, I would need to define a function like game_start().

    How can I do this?

    Continue reading...

Compartilhe esta Página