Game Development Reference
In-Depth Information
Figure 3-10.
Changing P1Serving to true
Keeping One Ball in the Game at a Time
Now, let's limit the number of balls in the game to one. (You can decide
otherwise later and adapt it to your own game's rules.)
You will use a Boolean attribute that will be changed to true as soon as a ball
actor is spawned and to false when the ball is destroyed. Then you will modify
the spawn behavior to check if this new attribute is false before spawning the
ball.
In the Scene Editor, select the Attribute Inspector pane. Create a new Boolean
attribute as per Figure 3-11.
Search WWH ::
Custom Search