How do I Create a health system based on a time countdown

  • I'm looking to have a system based on a global time that starts at a certain number, say 600, and begins to countdown slowly, once it gets in the low numbers say 10 - 0, I want to have the player get hurt and or killed.

    I have been looking in to number countdowns but I for the life of me cannot figure out how to associate Health with a timer. Could anyone point me in the right direction ? Any advice and or help would be great!

  • every x sec - 10 from life

    on event + life

    on event - more life

  • every x sec - 10 from life

    on event + life

    on event - more life

    Thanks for the reply.

    But this has me a little confused, if I set every x second - 10 from health than I cannot specify when the timer countdown actually hurts the player, as soon as you run the layout and it hits -10 seconds it hurts the player, I'm looking for a way so that when a timer goes down from say 600 once it gets to 30 = hurts player, 20 = hurts player etc. etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • every x sec - from timer

    if event timer - health

  • It took me a few minutes to figure it out

    But I do have a problem as I am trying to associate an image (heart) to the time thats taken away

    Do I need to set it so that Health1 starts before the other two groups (Health2) & (Health3) ? Since, with the way I have it now it's counting both Health1 & Health2 every x seconds at the same time, I need to have it so that after Health1 x seconds finishes it starts the Health2 every x seconds. Thanks for the help man

    PS : Fixed, major mistakes on my part! Thanks for the help Carbincopy

  • As I don't know how you have it setup. This will give a brief description of how it should look.

    if health greater then 400 heart 1

    if health less then 400 heart 2

    if health greater then 200 heart 2

    if health less then 200 heart 3

    if health =0 then zero hearts

    now you could get even more fancy

    and set every 1/4 set animation to heart 1 (frame 1-4)

    then that would call at every -50 since health is 600 and each heart has 200 points.

  • You could even do it with a progress bar behind a see through image of hearts.

    every x sec - from heart meter width

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)