GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Display animation with player health is reduced?

0belisk0belisk Posts: 189PRO
not sure if this is possible, and if it isnt not too bothered.

but basically, i have a health system, integer attribute giving the player 5 lifes.
i have an actor (health icon) with a replicate action set to the integer attribute.
so there is 5 lives in the corner of the screen, i was wondering if everytime an enemy hits the player, lust removing one of the health icons, that it could display an animation?

would i need 5 different integer attributes and make each health icon independent? but then i would need to somehow make it remove the first health icon apon being hit, then detect that its not there when your hit again, and moves on to the next available health icon.

how would i go about doing this?

Comments

  • quantumsheepquantumsheep Posts: 8,188Member
    I tried this, and I don't think you can have an animation while using 'replicate'.

    I'd have the five different icons there.

    On the fifth one I'd have a rule that says:

    If game.health = 5 and player is hit
    Do an animation
    After 1 second (or however long the animation is) change the alpha to 0.

    On the 4th one:

    If game.health = 4 and player is hit
    Do an animation
    After 1 second (or however long the animation is) change the alpha to 0.

    And so on and so forth.

    Would that work?

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: http://www.quantum-sheep.com

This discussion has been closed.