Structuring game world entities and their rendering objects
Posted
by
keithjgrant
on Game Development
See other posts from Game Development
or by keithjgrant
Published on 2011-03-18T03:14:06Z
Indexed on
2011/03/18
8:18 UTC
Read the original article
Hit count: 280
architecture
|rendering
I'm putting together a simple 2d tile-based game. I'm finding myself spinning circles on some design decisions, and I think I'm in danger of over-engineering. After all, the game is simple enough that I had a working prototype inside of four hours with fewer than ten classes, it just wasn't scalable or flexible enough for a polished game.
My question is about how to structure flow of control between game entity objects and their rendering objects. Should each renderer have a reference to their entity or vice-versa? Or both? Should the entity be in control of calling the render()
method, or be completely oblivious?
I know there are several valid approaches here, but I'm kind of feeling decision paralysis. What are the pros and cons of each approach?
© Game Development or respective owner