Game Development Reference
In-Depth Information
Any entity in the game may have attributes that describe it: Vehicles have perfor-
mance characteristics, factories have production rates, and so on.
As with any simple entity, you should choose an initial quantity or state for an
attribute when you decide to include the attribute in your game.
FIGURE 10.2
Examples of three
different entities
A Simple
Numeric Entity
A Compound Entity
with Two Attributes
A Compound Entity Containing Another
Compound Entity as an Attribute
Points Scored
1,755,245
Wind
Avatar
Speed
35
Name
Money
Health
Race
Location
Voldarok
25
117
Elf
Feasting Hall
Direction
Northwest
Inventory
# Items
Item 1
Item 2
Item 3
Item 4
Item 5
5
Sword
Shield
Food
Helmet
Armor
IF YOU HAPPEN TO BE A PROGRAMMER…
If you are a programmer, you may have noticed that entities sound a lot like objects in
object-oriented programming: They include variables for storing numeric and symbolic
values and may be made up of other entities in the same way that programming objects
may be made up of other objects. And like classes of objects in programming, entities
have associated mechanics (though programmers would call them functions or methods )
for manipulating these data.
For most practical purposes, you can treat entities and programming objects as identical,
and if you happen to program as well as design your game, you will certainly implement
entities as objects in your code. This topic uses the term entity rather than object
because we normally use object in the everyday sense to refer to some physical item in
the game world.
UNIQUE ENTITIES
If your game contains only one entity of a particular type, then that is a unique
entity . In most adventure games, the objects that the avatar can pick up are unique
entities. The avatar itself in most games is a unique entity because there is usually
Search WWH ::




Custom Search