Close
Close full mode
logoMakeCode AP CSP

Making and Using Extensions

Activity

Go to Activity: Making and Using Extensions.

Complete student tasks 1, 2a, and 2b.

Tasks

Task 1

  1. Add 3+ new sprites of kind Obstacle placed randomly between Football and Goal.
  2. Add an overlap event:
    1. Ball hitting an obstacle causes game over.
  3. Comment your code.

Shared project link:

Task 1 Challenge

Add controller event:

Pressing the B button stops the ball at its current location.

Shared project link:

Task 1 Extension

Recreate project using JavaScript.

Shared project link:

Task 2a:

  1. Add an on game update every 500 ms with:
    1. Projectile that represents a star
    2. Random vx so it moves across the screen to the left
    3. Random y position
    4. Projectile ghost on
  2. Comment your code.

Shared project link:

Task 2b

  1. Add a new background color.
  2. Add a countdown block.
  3. Add a meteor projectile that spawns every 750 ms and moves across the screen to the right.
  4. Add comments.

Shared project link:

Task 2 Challenge

Import Task 2b code as an extension in another project.

Shared project link:

Task 2 Extension

Recreate project using JavaScript.

Shared project link:

Reflection

  1. How could you use extensions to create a group project with four or more students?
  2. What is one benefit to using extensions as a way to reuse code from existing projects, versus just copying the code?
πŸ“˜ Unit 5 - AAP Part 2 β€” Previous
Using Extensions
Next β€” πŸ“˜ Unit 5 - AAP Part 2
Day 5