You should now be well equipped to create almost any 2D game you want. We discussed vectors and how to work with them, resulting in a nice, reusable Vector2 class. We also looked into basic physics for creating things like ballistic cannonballs. Collision detection is also a vital part of most games, and you should now know how to do it correctly and efficiently via a SpatialHashGrid. We explored a way to keep our game logic and objects separated from the rendering by creating GameObject and DynamicGameObject classes that keep track of the state and shape of objects. We covered how easy it is to implement the concept of a 2D camera via OpenGL ES, all based on a single method called glOrthof(). We discussed texture atlases, why we need them, and how we can use them. We expanded on the concept by introducing texture regions, sprites, and how we can render them efficiently via a SpriteBatcher. Finally we looked into sprite animation, which turns out to be extremely simple to implement.
In the next chapter, we'll create a new game with all the new tools we have. You'll be surprised how easy that will be.
Was this article helpful?