3

Well I was looking at a few game based tutorials, as well as articles. I found out about two terms:

Entities and Sprites. Now they seem related but different, what is each and how are they the same and/or different?

I have some basic ideas already:

  1. An entity is an item/thing/object/person any object that can be interacted with in the world.

  2. A sprite is like an entity, but usually for NPCs/players/monsters.

  3. Or a sprite can be the name of a picture assigned to a specific entity.

Do I have the right idea or are sprites and entities something completely different?

Rivasa
  • 333
  • 1
  • 2
  • 14
  • I was going to remove the entity-system tag, because it seems like you're not talking about entities in that sense. Is that correct? – House Jul 30 '12 at 00:12
  • It's correct, It was just the closest tag that I needed, that was all. – Rivasa Jul 30 '12 at 00:14
  • Oh, I misread your comment. You are talking about entities in entity component systems? Or you're just talking about entities/characters/guys/objects in game? – House Jul 30 '12 at 00:16
  • The latter. Just in game – Rivasa Jul 30 '12 at 00:17

1 Answers1

7

An entity is a thing which exists in the world that is not represented by terrain. Entities generally have a position in the world, collision with the terrain and/or other entities, etc.

A sprite is a 2D bitmap that is drawn to the screen somewhere. Entities can have sprites, but they don't have to (in which case, they generally aren't drawn), but sprites cannot have entities. A sprite is purely a visual construct.

Sprites do not even have to be associated with entities at all. Particle systems, which are usually just visual fluff (ie: don't have gameplay effects) will generate one or more sprites.

In short, you need a separation between what is happening in terms of the game and what the player is seeing. The player sees sprites, while the gameplay code deals with entities and collision regions.

Sprite-less entities are often used for just their collision-detection properties. That is, you place an entity somewhere in the world and set something to happen when the player or something else touches their collision region. This lets you know when the player has reached a location or something.

Nicol Bolas
  • 26,068
  • 3
  • 76
  • 104