Close
Close full mode
logoMakeCode AP CSP

Solutions for Teacher - Projectiles from Sprites

Projectiles

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: projectiles task1

Task 1 Challenge

Made something happen when the two projectiles overlap one another.

Shared project: projectiles task1 challenge

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: Random Dodge

Task 2a Challenge

Made the projectile move at a random rate between 40 and 60.

Shared project: Random Dodge Challenege

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: screenFill

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 Activities
Next β€” πŸ“˜ Unit 3 - AAP Part 1
Day 17