What is the difference between "Entity" and "Sprite"?

Started by
21 comments, last by Daaark 11 years, 2 months ago
For me, Entity is the top level thing, and it contains components, among them perhaps a sprite.

The sprite is rendered because the sprite component registers it with the graphics subsystem.

Similarly, an event listening component could register to receive events. But what I actually do is push the events out, because I know which entities need input.
Advertisement

So, in conclusion: Game object = (could be?) = entity + sprite.

Yes, that or whatever works best for your purposes.

There is no 100% catch all answers for things like this, because programming allows you to organize your data any way you like.

Figure out how your game is going to work. Then you'll know what data you need to keep track of, and how you'll need to organize and process it.

A GameObject class will then consist of anything you know you'll need. Then an entity will also consist of anything the logic will need to see. It might even be an abstract class with different versions that do different things.

This topic is closed to new replies.

Advertisement