Making and Using Extensions
Activity
Go to Activity: Making and Using Extensions.
Complete student tasks 1, 2a, and 2b.
Tasks
Task 1
- Add 3+ new sprites of kind Obstacle placed randomly between Football and Goal.
- Add an overlap event:
- Ball hitting an obstacle causes game over.
- 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:
- Add an on game update every 500 ms with:
- Projectile that represents a star
- Random vx so it moves across the screen to the left
- Random y position
- Projectile ghost on
- Comment your code.
Shared project link:
Task 2b
- Add a new background color.
- Add a countdown block.
- Add a meteor projectile that spawns every 750 ms and moves across the screen to the right.
- 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
- How could you use extensions to create a group project with four or more students?
- What is one benefit to using extensions as a way to reuse code from existing projects, versus just copying the code?