Introduction to Component Based Architecture in Games

This is a blog post by site administrator Ray Wenderlich, an independent software developer and gamer. When you’re making a game, you need to create objects to represent the entities in your games – like monsters, the player, bullets, and so on. When you first get started, you might think the most logical thing is […] By Ray Wenderlich.

Leave a rating/review
Save for later
Share
You are currently viewing page 7 of 7 of this article. Click here to view the first page.

Where To Go From Here?

Now that you have a firm understanding of how to make components and systems that use components, converting the rest of the project to the Entity System model is a fairly straightforward port - but time consuming.

It would take forever to explain each step in this tutorial, so instead I have done this for you. Go ahead and download the completed port and check it out. You can also look at the git history that comes with the project to see how I built it up one piece at a time.

Note I'm not convinced this is the most elegant way to do this, but it is a full working example of a simple component based game - which are in rare supply! :]

As I mentioned earlier, if any of you have ideas for how to make this project better, feel free to update the project and send me an updated version! As mentioned earlier, I'll post any alternative versions here so others can learn and benefit.

I hope this article has helped you learn the basics about component based architecture and get some ideas for how you might like to approach it with your games. Remember, the key is to prefer composition over inhertance - how you make that happen is a matter of style and preference! :]

Huge thanks to Adam Martin for tech reviewing this tutorial.

If you have any comments, questions, or suggestions for this tutorial, please join the forum discussion below!


This is a blog post by site administrator Ray Wenderlich, an independent software developer and gamer.

Contributors

Over 300 content creators. Join our team.