Hey there,
When I saw this lecture about cheat keys (C and L), it triggered me a bit, to mention “Debug” and “Release” builds.
I don’t want to sound like superman, please don’t get me wrong, I just share my thoughts and try to add some constructive information.
I know, this course is super basic (at the moment) in terms of C#, but maybe it would’ve been a good idea, to answer a question, some users might have in mind, when they work through this lecture:
"Yeah, ok, cheat keys..., but what if my game is finished? Do I have to find all the places, where I placed cheats and backdoors? how can I make sure, that my game on steam does NOT react on these cheat codes?"
I think, it would’ve been ok to mention #if DEBUG
at least for a moment, and telling that “we DO have options to exclude part of our code, when we finally release a game, for now, take this as an information, that this code will only be compiled while you develop the game, but not in release mode. We’ll cover builds a bit later, for now take it as it is” … something like that, because I think, the cheat function should look like:
void Update()
{
ProcessThrust();
ProcessRotation();
#if DEBUG
ProcessCheats();
#endif
}
#if DEBUG
private void ProcessCheats()
{
if (Input.GetKeyDown(KeyCode.L))
handler.ChangeLevel(handler.PlayWinAnim, "LoadNextLevel");
if (Input.GetKeyDown(KeyCode.C))
handler.ToggleCollisions();
}
#endif
kind regards,
Mike