Heart Bar

BackUpAndDownBackUpAndDown Member Posts: 685
edited November -1 in Working with GS (Mac)
Hey,

I'm making a game that uses a health bar similar to the zelda and metriod games. Instead of a solid bar that adjusts its length depending of the health of the character I want each health point represented by a "tick" or "heart" image.

I have an idea on how to do this but would like to hear some other suggestions, just so that I know i'm doing it as efficient as possible.

Thanks

Comments

  • peachpellenpeachpellen Member Posts: 977
    game.hearts = 3 (assuming you start with three lives)

    When an enemy hits you;
    change attribute game.hearts to game.hearts-1

    On the third heart have;
    if game.hearts is < 3 destroy this actor

    Or, if you are planning on the hero being able to regain lives I'd say to put;
    if game.hearts < 3 change image to *transparent image*
    Otherwise change image to *original heart image*

    I think that's about right.
  • juzcookjuzcook Member Posts: 259
    better yet, use the hearts attribute peach mentions, but use replicate instead of individual heart actors :)
  • BackUpAndDownBackUpAndDown Member Posts: 685
    Would it still work if I set the alpha of the "heart" to 0 instead of destroying the actor? or will that slow the game down?
  • RHRH Member Posts: 1,079
    BackUpAndDown said:
    Would it still work if I set the alpha of the "heart" to 0 instead of destroying the actor? or will that slow the game down?

    thats probably better...
  • BackUpAndDownBackUpAndDown Member Posts: 685
    Also, could someone explain how to set different rules on a replicated actor? How do I customize the "if game.hearts is < 3 destroy this actor"? Wouldn't all of them be <3?
  • BackUpAndDownBackUpAndDown Member Posts: 685
    RH said:
    thats probably better...

    I plan on having 50+ health actors, is the alpha techniques still better? =P
Sign In or Register to comment.