Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to make the Wizard tutorial program into a continuous game?

I've added player input for casting spells and meditating, but I want to make it run and accept input continuously until I terminate it. I know it involves a For Loop but I can't figure out how/where to utilize it! Any help is appreciated, thank you


Best Answer

  • HNJHNJ Member
    Accepted Answer

    declare a boolean somewhere

    run = True;
    

    between line 39 and 40, start your

    while run == True {
    


    and between line 79 and 80 end it. or I can say wrap the whole code block inside static void main in the while loop.

    And add a new Console.readline asking if player wants to end the game, if it is 'y' or 'yes', then make

    run = False
    


    Then when the next loop runs, variable run will be false and the loop will terminate.


    Hope this helps.

Answers

Sign In or Register to comment.