Heath bar help.

DELETED_117713

  • Posts: 771
I have made a heath bar. Each lossed heath segment is a animation frame. How do i make it so that when the player gets hurt. It changes frames until the last one then the player dies.

squirened

  • Posts: 34
You can use a Flow-If<Health> conditional on updating to determine the amount of health/max health and then use that to call an Actor-Draw-SwitchToFrameXForSelf. You could do this for either When Update or When Draw, I'm not sure if it matters, though When Draw may produce better results.

It'll look something like the attached photo.

Note that I haven't tested this myself, but I've done similar so I'm sure it'll work unless there's an error. If you're not on the appropriate animation, however, this won't work, but you sound like you have one animation with multiple frames for each thing of health.

Tuo

  • *
  • Posts: 2469
Squire is correct, but "health" will likely be a number attribute, the other side of the equals will be numbers, and the switch animation will likely be "Animation 0" (or another number with it).
Don't look to me but rather to the One who is the reason for what I do. :)

If you need help, send me a PM. Even if I haven't been on in the forums in ages, I still receive those messages via email notifications. You can also reply to any of my forum posts, regardless of the age (especially if I created it), and I will likely reply.

If you want to see the programming behind certain types of games, feel free to check out my "Demo-" games on StencylForge (http://community.stencyl.com/index.php/topic,16160.0.html)