Step 10: Ball Edge Collision Code 2

Goal:


Now that we have a Game Over Message, let’s tell the ball how to act once the game ends.

We also need to tell it what to do when it hits any other edge besides the bottom one.

Steps:

  1. From Ball1, place a set Ball1.Enables block.
  2. From Logic, attach a false block to the end of the set Ball1.Enables block.
  3. From Ball1, place a MoveTo block.
  4. From Math place a 0(zero) block in both the x and y slots of the MoveTo block.
  5. From Variables, place a set Points block.
  6. From Math, attach a 0(zero) block to the end of the set Points block.
  7. From Ball1, place a Bounce edge block outside of the IF/THEN block.
  8. From the EdgeReached block, hover over the orange edge circle, then grab the get edge block and attach it to the end of the Bounce edge block.

Code: