leoncross's Forum Posts

  • kriand

    Wow, you did it! Though the other method worked fine, the code is much cleaner. I incorporated the damage part and it works great!

    I even added the ability to stop the sine behavior on the dark hearts.

    I'll try adding the healing events and the Max HP powerups.

    Nice idea though, I thought of putting an index variable but I hadn't thought of matching the index of the heart sprite with the Player's HP...!

    Excellent!

    Thanks for making this!

  • kriand

    facecrime

    Hey guys, Destroy on its own did not work, but I incorporated the idea of having the dark heart

    under the colored ones and used this:

    Player Health Points =/= HUD_Hearts.Count

    Hud_heart Pick furthest to (0, 24)

    Repeat Player.Health.LastDamagePoints times

    Every tick

    It works great! At least with some preliminary testing.

    The hidden dark hearts still show though, I may have to play a bit with their visibility.

  • kriand

    Yes, I'd like to avoid making so many "animations", as accounting for all the possibilities will take a lot of tedious work.

    However, if all else fails, I'll do it that way, haha...

    The thing is every Heart sprite has a nice Sine effect which I think would look weird if all Hearts are one Sprite.

    facecrime

    Hmm... Nice idea with the tilemap, though it would break my Sine effect too. I'm also drawing the hearts a bit closer to each other that the tilemap would allow I think.

    I like your idea of having a black heart under the red ones (Well, blue in my case). I'll try destroying the furthest red heart sprite and see if that works.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello guys,

    I'm having some trouble with the Player Health HUD.

    The concept is this:

    The Player's Hit Points are represented by Hearts. Each Heart is a different Sprite.

    The Player can purchase Items that increase his Max Health to a maximum of 8.

    He starts with 3 though.

    Every time he gets hit, the Heart that is furthest from the point 0 in x gets dark (Animation change.)

    I managed to accomplish this and it works great when the Player gets damaged by 1.

    If damaged by more than one though, the system falls apart and only shows one damaged heart from then on.

    I've tried doing it by my own functions and Dictionary and by using the Health behavior bought from the Scirra Store with no luck.

    Here is what I'm doing:

    [Creating the Heart Sprites]

    On start of layout

    Repeat.Player.PlayerMaxHealth Times -> Create object HUD_Heart on layer "HUD" at (40 + (loopindex * 14), 24)

    [Damage]

    Player - On Health Damaged

    HUD_Hearts - Pick furthest to (0,24)

    HUD_Hearts - Is animation "Default" playing

    Repeat Player.Health.LastDamagePoints times (Health behavior includes value for the last damage received)

    ->

    Set animation to "Dark"

    (Wait 0.5)

    So, do you have any ideas? As I've said it works fine until the character gets damaged for more than 1 HP.

    I've tried various variations on the above logic yet nothing changed.

    I'm quite new to Construct though so maybe I'm missing something?

  • I see. Thank you.

    I've decided to get it on Steam.

  • Hello!

    I'd like to purchase a Personal License but I have a question.

    Does the Personal License include a Steam code to activate the Engine on Steam?

    I like having it there but I'm also interested in purchasing the "Beginner Pack 2" bundle which is only available to this site.