Game Development Reference
In-Depth Information
change game.EnergyBarInit to game.EnergyBar. The rule is shown in Figure
5-28. The last behavior will ensure that the new value after completion of the
interpolation is stored into the buffer to be used for the next collision.
Figure 5-28. Collision detection
EXERCISE 5.4
Using Interpolate, Timer, and Alpha, make the Energy Bar blink when it is in the red color zone.
Scene Management
Last but not least, let's look at the Change Scene behavior. This behavior is very
simple to use, and it changes your action to another scene. The scene could be
the next in order or a specific scene that you have chosen, such as back to the
menu.
Basically, you want to change the scene when there are no more carrots on the
screen. This means that the attribute number Carrots is equal to 0. You already
have a rule in the game that detects when the condition numberCarrots
equals 0.
 
 
Search WWH ::




Custom Search