Projectiles Activities
Projectiles
Complete the following activities to learn more about how projectiles are used in MakeCode Arcade games:
Flying Bird Code Segment
- Open the FlyingBird code in MakeCode Arcade and explore the what the code is doing.
- Change the vx and vy numbers to positive numbers other than 50.
- Change the vx or the vy numbers to a negative number.
- Note your observations about what happened when you changed the numbers here:
Activity
Go to Activity: Projectile Sprites and complete student tasks 1-3.
Task 1
Modified code for ball to fall at a rate of 50. Created a second projectile that goes up the screen at the rate of 50.
Shared project:
Task 1 Challenge
Made something happen when the two projectiles overlap one another.
Shared project:
Task 2a
Modified code so each time a projectile is create one point is added. Modified the create projectile block so each spawned meteor moves down the screen at a rate of 50.
Shared project:
Task 2a Challenge
Made the projectile move at a random rate between 40 and 60.
Shared project:
Task 2b
- Start with sample code.
- Place code in a for index loop.
- Modified the code so 13 projectiles are created every 300 ms.
- Modified the code so that each projectile starts further down the screen on each iteration.
Shared project:
Reflection/Homework
- How did using a loop in Task 2b help reduce the amount of blocks that were used?
- What are the benefits of using projectiles rather than normal sprites?