Switch Statement to the Rescue

How does this even work?

We looked at Creating a Modular Powerup System in the previous article as we progress through the 2D Space Shooter for GameDevHQ. The script for the powerups called a single method on the player class and had no definition of how the player was actually impacted by collecting the powerup on the screen.

Today we will talk about the magic behind making that happen. As previously mentioned I deviated a bit from…