Close
Close full mode
logoMakeCode AP CSP

Projectiles Activities

Projectiles

Complete the following activities to learn more about how projectiles are used in MakeCode Arcade games:

Flying Bird Code Segment

  1. Open the FlyingBird code in MakeCode Arcade and explore the what the code is doing.
  2. Change the vx and vy numbers to positive numbers other than 50.
  3. Change the vx or the vy numbers to a negative number.
  4. 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

  1. How did using a loop in Task 2b help reduce the amount of blocks that were used?
  2. What are the benefits of using projectiles rather than normal sprites?
πŸ“˜ Unit 3 - AAP Part 1 β€” Previous
Projectiles Part 1
Next β€” πŸ“˜ Unit 3 - AAP Part 1
Day 17