Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Ok, now that we have all the images created, and the bullets have been brought to life with behaviors, we have to program in the bullet collisions.
Let's double-click our Enemy actor, and create a new rule. Rename it to Destroy and change the settings to Actor receives event | overlaps or collides | with actor of type | Bullet.
We want to add some health for these baddies. Under the attributes box of the Enemy actor, click the + button to create a new attribute, rename the attribute to Health, and change the value to 4, as shown in the following screenshot:
What this will do is remove 1 health each time a bullet hits it. Easy enough, eh? Now, add in another rule, rename it to Die and change it to Attribute | self.Health | = | 0.
Then, drag in a Destroy behavior.