enemy wave bar

quinn221quinn221 Member Posts: 280

What would the best way be to handel an enemy wave bar.

I am working on a concept where their will be diffrent number of enemys on each scene. For example lets say I want the thrst scene to be a wave of 20 enemies. I would like to have something sort of like a health bar at the to that gets shorter eevrytime a enemy is killed. When it hits 20, the health bar is gone then you move to the next scene.

But when you go to the next scene the wave count will now be higher or lower based on how many enemys I want on that scene.

Any ideas?

Comments

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

    Use the Replicate behavior with the Copies set to game.enemyCount and the Spacing set to self.Size.Width. Make the actor width 10 pixels or whatever you prefer.

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

  • quinn221quinn221 Member Posts: 280

    @tatiang said:
    Use the Replicate behavior with the Copies set to game.enemyCount and the Spacing set to self.Size.Width. Make the actor width 10 pixels or whatever you prefer.

    That is kind of what I did, but the problem I am running into is that I want the bar to be the same lenth on each scene. Make sence?

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

    If you want the bar to have the same length, change the actor's width to game.barWidth/game.enemyCount. I haven't tried doing that with Replicate but I'm guessing it would work. So for example, on the first level the width might be 200/20=10 and on the second level the width might be 200/10=20.

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

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

    Here's a demo.

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

  • quinn221quinn221 Member Posts: 280

    @tatiang said:
    Here's a demo.

    Thnak you this is great!!!!

Sign In or Register to comment.