Simple attributes for creating a boss - can anyone help?

LokitoesLokitoes Member, PRO Posts: 187
Hi there,

I am new to GS and I am looking for a tutorial to make a simple boss actor. Basically I just want a character who doesn't die on the first hit. How do I set up a rule that makes it so that the boss doesn't die until, say, after the 10th hit?

In saying this, I am only assuming that number of hits is the usual way one would set up rules for a boss actor - are there any other common ways?

I've looked at the boss's attributes for the 'shoot-em-up' template that comes free with GS but without explanation it isn't helping me.

Thanks for any help anyone can give me!

Comments

  • theviljestertheviljester Member Posts: 1
    set the bosses health higher
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    You can add a custom attribute to any actor. So in this case you would make an integer attribute in the boss actor called self.health (or anything you like) and set its initial value to 10. Then have a rule that says When attribute self.health ≤ 0 --> destroy actor.

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

  • LokitoesLokitoes Member, PRO Posts: 187
    Thank you :)
  • quantumsheepquantumsheep Member Posts: 8,188
    I've attached a file.

    In the boss, you'll notice that under the image (top left) are some attributes. You can, as @tatiang noted, make your own by pressing the little '+' button in that section.

    These are called 'self' variables.

    Notice I made a new one called 'BossLife' and gave it a value of 10.


    In the main rules section, the first thing I did was set the bosslife value to 10 again - this is in case the player restarts or dies before killing the boss.

    The next section basically says:

    If boss is hit by a bullet actor
    CHANGE the value of bosslife to bosslife-1

    This takes 1 off the boss health every time it's hit.

    It *also*, for .1 seconds, changes the boss alpha to .5 - which is one way of showing it's been hit.

    Lastly, there's a rule that states:

    If Bosslife is less than or equal to 0, then destroy the actor.

    Hope that helps!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

Sign In or Register to comment.