Step 6: Ball1 Starting Code

Goal:


Now that we can control our paddle, we need to code how fast the in what direction the ball starts off moving.

Steps:

  1. From Variables, place an Initialize global block on the the screen, and set the name to points.
  2. From Math, attach a zero block to the end of the Initialize global block.
  3. From Screen, place a Initialize block.
  4. From Score, place a dark green set score.text block inside the Screen.Initilize block.
  5. From Variables, attach a get block to the end of the set score.text block and set the variable to points.
  6. From Ball1, place a set Ball1.Heading block.
  7. From Math, attach a 0(zero) block to the end of the set Ball1.Heading block and set it to 10.
  8. From Ball1, place a set Ball1.Speed block inside of the Initialized block.
  9. From Math, attach a 0(zero) block to the end of the set Ball1.Speed block and set it to 75.

Code: