Game Development Reference
In-Depth Information
Moving Player 2 Racket to the Stored Value
1. Open the Rack Player 2 actor in the Actor Editor.
2. Create a new rule and add the following condition:
Attribute game.positionyourself is true.
This detects the allowed period to move itself to move to the stored position.
3. Drag a Move To behavior.
4. Configure the Constrain Attribute as per Figure 3-17.
Figure 3-17. Constrain Attribute
You also need to do a modification on the Serving function so that Player 2 can
serve automatically after winning a point. To do so, just remove the condition
that the space key is pressed by scrolling over and clicking the - sign next to the
condition.
The modified rule is shown in Figure 3-18.
 
Search WWH ::




Custom Search