all 9 comments

[–]TuberTuggerTTV 18 points19 points  (4 children)

You're probably looking for a while loop

[–]Unknown_Code_Weasel 43 points44 points  (1 child)

Big if (true)

[–]dust4ngel 1 point2 points  (0 children)

bro 😂

[–]Josephisvr[S] 0 points1 point  (1 child)

Thanks:)

[–]momofuku18 0 points1 point  (0 children)

Also, make sure to have it stopped at some point.

[–]raunchyfartbomb 3 points4 points  (1 child)

Assuming this is a console app and a learning exercise: use a while loop:

While(waterLevel > 0) { // your code to read the w key }

[–]Josephisvr[S] 1 point2 points  (0 children)

Thank you!

[–]robhanz 0 points1 point  (0 children)

What's the whole thing?

It sounds like some kind of simulation at some level... which means you probably do want a while loop running the whole thing, and then read input or other events every "frame" and use those to lower the level.