Galaxy Shooter — Phase II: Core Programming
May 8, 2021
Day 41 — Aspiring Game Creator
2D Game Dev: Galaxy Shooter
Objective: Power-Up Collect: Magnet Power “Cheat Key”
Pseudo Code:
- Create Ultimate “Magnet” Power-Up.
- Upon collecting the player can enabled a cheat key “C”. Once enabled any power-ups and pick-ups will move toward the player.
- This power will be in place for 20 seconds.
- This ability cannot be activated when The Shield is in place, but if activated before The Shield, all power-ups and pick-ups will be zapped by The Shield.
The change to the Power-Up class was fairly minor. First, a new static variable was introduced in the GameManager class: magnet. Once the “C” is pressed the magnet bool is set to true and any and all power-ups & pick-ups will move to the player.