evanwalsh Posted May 16, 2014 Share Posted May 16, 2014 Hello! I'm puzzling through how one would use an Entity-Component System with Phaser. Normally, I'd add a Sprite component to an Entity, but Sprites in Phaser are kind of like entities, in that they are more than just a texture. Also, Sprites are added to the Game, which then handles rendering them. Normally an ECS-style System would handle their display, so I'm feeling a bit lost. How do I use an ECS with Phaser? Specifically, I'm trying to use ces.js, but if someone has a better library, let me know! Thanks! Link to comment Share on other sites More sharing options...
Mike Posted May 17, 2014 Share Posted May 17, 2014 It's not a simple topic and the short answer is you are not supposed to use Phaser in an ECS since Phaser is not organized that way. Check this topic: http://www.html5gamedevs.com/topic/2855-has-anyone-used-an-ecs-pattern-in-their-phaser-project/?hl=entity Link to comment Share on other sites More sharing options...
Noid Posted May 17, 2014 Share Posted May 17, 2014 If you want to create html5 games using ECS I think the most popular option is http://craftyjs.com/ Link to comment Share on other sites More sharing options...
David Posted May 17, 2014 Share Posted May 17, 2014 KiwiJs is supposed to be using the ECS pattern. That is according to it's listed features on the main page. I haven't actually looked at any of the code, so I can't speak to how well it's implemented. One thing to note: Crafty isn't really ECS. It's more EC. From the wiki article you pointed to: System: "Each System runs continuously (as though each System had its own private thread) and performs global actions on every Entity that possesses a Component of the same aspect as that System." Where distinct systems would normally contain logic, Crafty bundles logic with components instead. Link to comment Share on other sites More sharing options...
CrazySam Posted May 19, 2014 Share Posted May 19, 2014 Look at Flambe for a modern game framework that uses Entity / Component model. Link to comment Share on other sites More sharing options...
stasuss Posted May 20, 2014 Share Posted May 20, 2014 It's haxe, but nevertheless https://code.google.com/p/awe6/ Link to comment Share on other sites More sharing options...
Recommended Posts