Composition heavy OOP vs pure entity component systems?

Started by
30 comments, last by Mito 11 years, 7 months ago
Hey all~ I am back after a somewhat long absence, as I've been busy acclimating into my new job. I wanted to update you guys who took the time to help me with what happened! (And I might hope for a little feedback for how right (or how less wrong) I did things.)

So, after some more search, I fell upon the Apollo entity framework. It is built by the same folks who has made the Artemis entity framework, but is more 'object-oriented' in its thinking. I fiddle around with it in the past couple of weeks, and I must say I really do prefer it a lot over Artemis, which I wasn't planning on using.

This on the other, I loved! I'm not using the platform in its entirety (yet), and I have made some modifications of my own to suit my programming taste (to the builders, etc..)

I have made a small, small demo where I integrated it with LibGDX and Box2D, and I have the code up on Github for those who want to make me feel bad by telling me how bad it is. tongue.png

My architecture is essentially having the Apollo world contain the Box2D world (though I keep a separate reference for the Box2D world for convenience).

I have a Renderable component, along with a collidable component. The collision component depends on the Renderable component, but for the time being only, and only for practicing/experimenting with things, but they should be completely independent, and only separately depend on the Transform component which holds the position.

I have a collision detection listener which doesn't itself act on the bodies, but triggers a flag in the Collidable component and forwards it the needed information to handle the collision (the other body, its type, etc..)

I haven't used the event listeners built into Apollo, so I cant' say anything about that, though I might use it later on. Sorry about that, Gabriel, but I hope I can still answer some of your questions in the code.

I'm using builders like Apollo recommends, though I have modified those to take several parameters. This broke the methods related to builders (which was rather convenient) but it's nothing fatal. (To those who made Apollo, my sincerest apologies for butchering your framework!!)

So yeah, that's pretty much it! Don't judge too harshly.~

I wonder if I should start my own game dev diary.. But I don't want to infect people with bad code. xD
Advertisement

I wonder if I should start my own game dev diary.. But I don't want to infect people with bad code. xD


well, i think you SHOULD start one. this way you will learn much more. don't be shy. there's no such thing as bad code, only code that has not been polished yet wink.png

This topic is closed to new replies.

Advertisement