Game Development Reference
In-Depth Information
Having enemies flash quickly as their health
Gamers require some sort of feedback each time something happens to their pawn. This can
be auditory, visual, or kinetic (controller vibrations). Most frequently the cues are visual, as
many controllers still do not support a vibration feature, however. Unreal Tournament pawns
flash red briefly each time they are hit. While UDK natively does this, why not extend that idea,
and bring back something from the NES era of gaming, wherein enemies flash red as their
health decreases, and continues to do so more quickly as it reaches zero.
Getting ready
Start by having your IDE open and ready to make some changes. We won't have to create any
new classes, but we will alter the behavior of our existing ones by adding some functions.
How to do it...
Let's start by declaring the variables we'll use.
/** Used for flashing damage as pawn's HP drops */
var float DamageOverlayTime;
var LinearColor DamageBodyMatColor;
These will be used to store how long the damage will flash over our pawn, along with
the color used.
Let's set the values for those variables in our default properties right now:
/** Used for flashing damage as pawn's HP drops */
// The flash lasts this long (float)
// Sets the pawn to flash red
Search Nedrilad ::

Custom Search