Game Development Reference
In-Depth Information
Figure 5-12. Left Movement rule
Now implement an auto-fire of the bullets by the spaceship. To do so, create a
rule that states that as long as the number of carrots on the screen is strictly
larger than 0, a bullet is fired every 0.5 seconds.
Create a new rule and name it ''Auto Fire'' with the condition
''Attribute''''game.NumberCarrots''''>''''0''. Then drag and drop a Timer behavior
and change the settings to ''Every''''0.5'' seconds with ''Run to completion''
unchecked. Lastly, drag and drop a Spawn Actor behavior and change the
settings to:
Actor: Bullet
Layer Order: in back of actor
Direction: 0
Relative to: actor
Position: X: 0 Y: 0
Relative to: actor
The Auto Fire rule will be the same as Figure 5-13.
 
Search WWH ::




Custom Search