
1656.4. Physics for 2D Games
//========================================================================
// Damage
// This entity has been damaged by a weapon
// Override this function in the inheriting class
//========================================================================
void Entity::damage(int weapon)
{}
Listing 6.18. e damage function is designed to be overridden.
6.4 Physics for 2D Games
Now that our game entities are colliding, we need some way to make them react to the col-
lisions. Physics to the rescue! In this section, we will examine some simple physics that may
be applied to 2D games. is section is in no way meant to be a comprehensi ...