KyleRansford
Member
Hello, I have a game where enemy objects can be destroyed in 2 different ways, but I'd like 2 different things to happen depending on how the enemy object was destroyed.
For example,
if an enemy object goes off of screen or out of room the enemy object is destroyed and the enemy objects can be destroyed by the player.
What I'm wanting to do is, that when the enemy object is destroyed by the player, I have in the destroyed function to add 100 points to the score, but if the enemy object is destroyed by going out of the screen or out of the room or any other way that wasn't by the player, I don't want to give the player 100 points. I just want the enemy object to be destroyed.
How can I do this? Having a conditional destroy function?
For example,
if an enemy object goes off of screen or out of room the enemy object is destroyed and the enemy objects can be destroyed by the player.
What I'm wanting to do is, that when the enemy object is destroyed by the player, I have in the destroyed function to add 100 points to the score, but if the enemy object is destroyed by going out of the screen or out of the room or any other way that wasn't by the player, I don't want to give the player 100 points. I just want the enemy object to be destroyed.
How can I do this? Having a conditional destroy function?