Step 13: TIE-Fighter Time-Bomb Collision

Goal:


Our Bomb is now ready to be fired, but we still need to program our enemies to explode when they touch it.

We already have one enemy, the TIE-Fighter, who can collide with the laser. Let’s add some code to this enemy so that it can also collide with the Time-Bomb.

Steps:

  1. Select the sprite called TIE-Fighter.
  2. Find the block of code that starts with “When I start as a clone”, and has all of our collision IF statements in it.
  3. Right-Click the IF statement block that deals with the X-Wing Collision and select duplicate.
  4. Drag and place the newly created code below the IF statement block for the X-Wing collision.
  5. Change the touching block in the new code to “Time_Bomb.
  6.  Change the amount in the new change score block to 1.

Code:


Click to replay