Game Development Reference
In-Depth Information
AddWeapon( WEAPON_ROCKETS, 6 );
}
void CAgent::AddWeapon( WEAPON_TYPE WeaponType, USHORT Ammo )
{
sWEAPON_INFO ThisWeapon;
ThisWeapon.Ammo = Ammo;
ThisWeapon.pWeapon =
mpWeaponCollection->GetWeaponPointer( WeaponType );
mvWeapons.push_back( ThisWeapon );
}
All Dressed Up and No One to Kill
By this point, we have created our objects and filled our lists. Our weapons have
stats and functions describing their abilities, our enemies have stats and weapons,
and our agent has stats, weapons, and enemies. None of that veritable cornucopia
of information, however, yields a decision on its own. All we have is information .
Even the nifty formulas that calculate the accuracy and damage that the weapons
cause are only different forms of information.
We have assembled the factors that we believe will be important to our decision
just as a glance at the ingredient list for a cake tells us what we need to have handy.
It does not tell us how we should combine those ingredients or what we need to do
with them once they are in the same bowl. For that, we need to begin to identify
how these components will work together.
I DENTIFYING R ELATIONSHIPS
The first step we must take in combining our data into something meaningful is to
identify the items that are directly related. We already touched on a few simple
relationships. For example, our formulas for weapon damage and accuracy use
distance as one of their components. Therefore, if we know the distance to a target,
we can enter that into the formula for a particular weapon and generate a result. We
have established a relationship between our location, that of our target, and the
weapon.
Search WWH ::




Custom Search