How to do an ammo remaining bar on a sideways scroller?

Hi

I'm completely stumped here, so hope someone can help?

My games a horizontal scroller. The player starts with a pistol and at the moment I've added a flamethrower powerup pickup. All working fine with the bad guys going up in flames as they deserve.

BUT....I cant for the life of me work out how to add a ammo bar that stays on the screen showing flame ammo remaining.

Ive already added a hero health bar which is locked using layers. I've tried doing the same for this , but it shows 100% ammo even before you collect the flamethrower. So I've tried creating an ammo bar with zero ammo so the second you collect the flamethrower it jumps to 10 and shows the display bar, but this crashes gamesalad :(

I'm sure plenty of you have done this before - so how do you do it? - I'm stumped!

thanks

Neil

Comments

  • Neil TNeil T Member Posts: 25
    sounds like a plan - but how do I change the opacity using a change attribute?
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
  • Neil TNeil T Member Posts: 25
    but the player sprite only collides / touches the flamethrower icon, therefore as its not touching the ammo bar itself how do you change the opacity of the ammo bar, as I have this setup as a different actor to the flamethrower actor.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    The way you communicate between actors is through the use of game attributes (or unlocking actors but that's another story). Have one actor change a game attribute (often a boolean but it's up to you) and then have the other actor react to that change by having a rule that checks the value of the game attribute.

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

  • Neil TNeil T Member Posts: 25
    brilliant - done that and it worked a treat - thanks so much!!
Sign In or Register to comment.