Game Development Reference
In-Depth Information
Figure 4-3. Initial velocity of the ball
Next, you need to ensure that the ball will collide with all collidable actors, so
use a Collide behavior.
Drag and drop a Collide behavior into the actor and change the setting to ''actor
with tag:'' and ''collidable'' as per Figure 4-4.
Figure 4-4. Collide behavior of the ball
Let's create the rule when the player misses the ball. You will use the same logic
as per the Pong game. An actor will be positioned below the racket and when
the ball overlaps it, it will destroy the ball and change the attribute ActiveBall to
false.
ClickCreate Rule and add the condition ''Actor receives event'' ''overlaps or
collides'' with ''actor of type'' ''loosing zone.'' Drag and drop a Change Attribute
behavior and change game.ActiveBall to 0. Then, drag and drop a Destroy
behavior just below the Change Attribute behavior. Your rule should be similar to
Figure 4-5.
 
Search WWH ::




Custom Search