Step 12: Player Enemy Collision Code 2

Goal:


We need an OR block because we want to run the same code if our player runs into a spike OR the yellow part of the platform.

An OR block allows code to run if at least one of the conditions is met.

Our conditions will be the set to the colors of the spike and the yellow part of the platform so our game knows when you have ran into an obstacle and need to be reset.

Steps:

  1. From Operators, place an OR block inside of the IF block.
  2. From Sensing, place a touching color block in both sides of the OR block.

Code: