Need pointers on code for console app.
I've been using c# inside of game engines for a while now, and I've just written some code for a simple console app for the first time for practice.
Code: https://paste.myst.rs/4j1fa1ss
I'm unsure about how good/bad this code is, the lack of an 'update loop' found in a typical game engine is throwing me off. My main concern is about the while loops when waiting for the player to make a valid input, is this standard practice?
I'm also finding that the execution is a bit hard to follow along my function calls, especially when thrown in with all the while loops. The calls are just nested and following the exection from Start() -> InspectPokemon() -> RequestPokemon() and back out feels wrong/difficult to follow
Any advice would be great, thanks.
pastemyst | Pokegam
a powerful website for storing and sharing text and code snippets. completely free and open source.
1 Reply
Using loops to "force" a valid choice is quite common, but i would recommend extracting that behaviour to its own method
You are doing it a lot and in many places, so it would clean this up a lot. Feel free to ask if you need help with this