Need Help with multiple hit to destroy option.

BaohBaoh Member Posts: 3

Good evening Guys,
I started using GameSalad about two weeks ago and I am working on my first game. Right now I am working on the mechanics like many of you probably are and I am running into a bit of a snag. I have a hero that reacts to a Melee button. I have an enemy that is destroyed when it comes in contact with the Melee area and the button is pressed. What I want to do is to set up the enemy actor to be destroyed on a more the 1 hit. I am talking maybe 2 or 3 hits depending on the enemy. I will be working on 4 - 6 different enemy characters and they will be using the same attribute but the numbers will be different. Any ideas or suggestions will be very helpful. Been hitting the wall with this one for the last 2 days.

Regards,
Baoh

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Each enemy will need to have its own self.health integer attribute that gets reduced when the enemy collides with the melee area actor and a boolean attribute called game.attacked is true. In your button actor, change game.attacked to true when the button is pressed and to false otherwise.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • BaohBaoh Member Posts: 3

    Thank you for the response tatiang, I will try this out and update.

  • BaohBaoh Member Posts: 3

    Thank you so much, Tatiang it worked perfectly. I guess I can use this same concept for the Hero's health. Thank You

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You're welcome!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.