Months ago, I was experimenting with HTML5 game development. Since it’s a fresh start, I thought, why not start with a better game architecture? So I made an experiment with Backbone.js, one of the famous JavaScript frameworks, but I don’t think MVC/MV* would fit for game development. That’s when I found entity-component based framework.
There are many famous game engines which already use this kind of framework like Unity3D or XNA. I found some on the list of JavaScript game engines but I was surprised when I found even more for ActionScript 3:
- PushButton (or now Smash)
- Citrus Engine
- Ember
- xEmber
I tried to learn more about this and found a very good article by Richard Lord. He wrote a good explanation on what entity-component framework is and why it ‘s better for game development. He also developed Ash framework for ActionScript 3. It includes a simple Asteroid game, but once I’ve read the source code, I was immediately sold to this framework.
Ash framework is simple and minimalist. It only includes the basic components which means you can combine it with your favorite 2D/3D, game or physics engines, and can be easily ported to JavaScript or Haxe (someone have already done this. See HashDS and Ash-Haxe).
So I made an experiment, extending the Asteroid game so it can support Native Flash, Starling, and Away3D. All renderers in one game!
Checkout the demo at http://abiyasa.com/lab/away3d/ashteroids/
Using Ash framework, it is easy to switch between renderers. The game logic and other components stay the same; the only difference is which renderer system is being used. Check out the GitHub page for more info about this 😉
It’s funny how I started with HTML5 game development but end up with a better ActionScript framework 🙂
Bonus: Some other articles on Entity-component framework:
- http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/
- http://www.tomseysdavies.com/2011/01/23/entity-systems/
- http://shaun.boyblack.co.za/blog/2012/08/04/games-and-entity-systems/
- http://gamedev.tutsplus.com/tutorials/implementation/avoiding-the-blob-antipattern-a-pragmatic-approach-to-entity-composition/
nice demo, thx for the bonus links.
thanks 🙂
Pingback: Experiment with Ash Framework | Abiyasa Blogs « eaflash