Mirai Hakurei's profile picture

Published by

published
updated

Category: Web, HTML, Tech

Moved my game from C to C++

Yesterday I decided to move my game to C++ because of classes and other benefits of object-oriented programming. I spent a bunch of time rewriting some things, but in the end, the game code was optimized a lot.

To give an example, instead of writing: "If the current screen is the title screen, then update the title screen and then draw it. But if it is the game screen, then update the game screen and draw it", I could simplify it to "update and draw the current screen" all of this by using a pointer to a class.

It was completely worth it. No clue why object-oriented programming is a hundred times better than procedural, especially for games.


0 Kudos

Comments

Displaying 0 of 0 comments ( View all | Add Comment )