Writing C++ code that controls the game's character