Updated the game_frame_render function.
Code cleanup and refactoring.