Step 3: Boss Activation Code

Goal:


Now that our boss is in place and has it’s health, we need to tell the game when to activate it.

We are going to do that by having the game check to see if we have reached a certain score threshold, and then to make a clone of itself on screen.

Steps:

  1. From Control, place an IF statement block inside of the forever block.
  2. From Operators, place a >(Greater Than) block inside of the IF block, and set the right side to 10.
  3. From Variables, place a round Score block on the left side of the >(Greater Than) block.
  4. From Control, place a create clone of myself block.
  5. From Control, place a stop all block, and change it from “all” to “this script”.

This stop block is a bit different the ones we have used before. Instead of stopping everything in our game, this block will only stop this block of code. This is very helpful when we need a forever look to check for a certain condition but only want that code to happen once.

Code: