Step 7: Paddle and Ball Collision 1.

Goal:


We can now control our paddle and our ball has a starting position, so now we need to tell these two objects how to interact.

The ball needs to bounce off of the paddle, change its speed and direction.

Steps:

  1. From Paddle, place a ColideWith block.
  2. From Ball1, place a set Ball1.Heading block inside of the ColideWith block.
  3. From Math, attach a neg block to the set Ball1.Heading block.
  4. From Ball1, attach a Ball1.Heading block to the end of the neg block.
  5. From Ball1, place a set Ball1.Speed block.
  6. From Math, attach a +(plus) block to the end of the set Ball1.Speed block.
  7. From Ball1, place a Ball.Speed block in the left side of the +(plus) block.
  8. From Math, place a 0(zero) block in the right side of the +(plus) and set it to 1.

Code: