So I’ve finished the LaserDefender section, and am working on expanding my game.
The first thing I’m working on is adding powerups. Using the scripting we used to generate the laser beams, when the enemy dies, it now randomly drops a powerup. Right now, I have 2 working powerups, Shields, and Shields+, they both add to the players health.
The problem I am having is with doing a weapon powerup.
I need to find out how to change the damage the projectiles my ship fires on the fly.
Is there a way to change the damage variable in Projectile.cs when, and only when, my ship fires a projectile?
Or would I have to create public variables in both player and enemy, and modify the Projectile.cs so it calls those variables instead of using its own variable? If that is the case, how would I tell whether Player or Enemy is doing the shooting?