Previously, pickups that help increase score and vitality were constructed, but nothing has been made that can actually cause Vlad harm. In this section, a simple hazard will be created. Then, a script will be written that will cause the player to "die" when they fall off the bottom of the screen.
Before creating any hazards, a new state should be created for Vlad: the death state. This will run when Vlad's health is set to a value less than or equal to
0 or if he falls below a specified value in the room.
A user-defined constant should first be created. In this instance, the constant will be named
state_death and set to a value of
3. This is so that User Defined 3 will be launched during the Step event ...