The 3rd one is a laser that can be used when pressing A:
BUG 1: When 3 projectile powerups are on the screen at the same time, once I get to stack the 2 different projectile powerups, the remaining 3rd powerup on the screen will not be destroyed in contact with mysprite.
BUG 2: When I get a laser powerup, an indicator regarding the laser will show up on the side of the screen. When I press A, mysprite will shoot laser and the indicator will disappear. However, if I have a laser power up and then got another laser powerup, once I press A, the indicator will not disappear.
Also, I need suggestions about how can I make the enemy shoot projectiles in the direction where my sprite is.
I’m heading out for the evening, but I definitely will take a look at this over the weekend.
You have a lot of code, so it will take some time to get through all of it.
When I run into bugs in a complex program like this, I try to disable everything that does not apply to the bug. So, if you are debugging the powerups, disable the code that creates enemies so that you can focus your attention just on the code for the powerups. (Disable blocks by dragging them out of, say, the forever block where they are contained. Disabled blocks are shown in lighter colors. It looks like you already know how to do that.)
For this one, you need to change your on overlap event handlers for PowerUP, PowerUp2, and Shield.
Because you might have multiple sprites of a given type on your screen, always use the sprite and otherSprite variables in your on overlap event handlers.
This one is a bit more difficult, but it’s a related problem. You may have multiple Bomb indicators on your screen, and you need to be able to handle that. I changed your on button A pressed event handler to look like this:
Each time you touch a Shield sprite, an indicator is added to the screen. If you touch multiple Shields, then you have multiple indicators. When you press the A button, the first indicator (or Bomb) is destroyed, leaving the other on the screen to be used later by the player.
The only other bug that I found was in your end game routine. Remove the call to startLevel.
If you want to see how I went about debugging your program, feel free to take a look here:
Basically, I moved all of the code in your forever loops into functions, and then I only called the ones that I needed. (So, I removed all bosses and minions to focus on the power ups). I also moved the code where power ups are spawned into their own functions so that I could call that code whenever I wanted.