This is where the state manager comes to play. To make this work we need a mechanism to switch between scenes and keep track of what’s happening without initializing and killing things manually in every flip. We would have the main menu, for example, a hole state with GUI and stuff to interact with, and the game state, the action itself, where all the game is played. In a simple game (the kind of game we will build with this engine) we would have one or more states, that represents different screens for the user. It’s a convenient way to organize code to be easily maintainable and keep it split by “concepts”. Games are divided in states or scenes, just like applications are divided in screens. In this first post we will cover one of the most important parts for any engine, the state manager or state machine. In this new serie we’ll explore the process of writing a hole 2D game engine in pure C (C89), why C? I don’t know… I like C and I think it’s mostly self explanatory, anyone should know C… I like to write games and i thought a full tutorial for the most important part (the engine) would be really cool to write for me and to read for you (hope). It has to work flawlessly, be performant, flexible and easy to use and understand.Įngines are a way to organize code, you can write games without one, just like any other software, but it’ll end up being a bloody mess, trust me. The core of any game is the engine, game engines are the most important piece, the foundation or everything to be built on.
0 Comments
Leave a Reply. |