Monster Destroyer 2.1

Hi Peter, you have a very interesting game. I like the idea that the projectiles fire off in all different directions.

I noticed a few ‘bugs’ in the game. Whenever you use the ‘overlap event’ to destroy the ‘other’ sprite, for example:

image

You need to reference the variables within the event block, i.e.:

image

So in this example, you are destroying the ‘sprite’ variable in the event loop, not the variable ‘Ghost’. Each time you create a ‘Ghost’, only the last sprite that was assigned to the variable is the one the can be destroyed. Try it in your game; let two ghosts appear, and have the first ghost kill you. You will notice that first sprite is not destroyed, because ‘Ghost’ points to the second ghost set in the game, and keeps on killing you.

Same thing for the projectiles.

image

image

In this example, you are destroying both the 'sprite (the projectile) and the ‘otherSprite’ (the enemy Ghost).

For all the projectiles, I also gave them a random life span. That way they will destroy themselves after the life span has ended. Otherwise the projectiles will just remain on the screen. You decide yourself if you want to change this.

Also, since you gave the projectiles a random direction, there is no need have them follow the enemy.

You can see my fixes here.

Let me know if you have any questions.
You have made a really good game, keep up the good work.

1 Like