How do I respawn my character with full health

  • I'm currently making a platform game but I'm having problem with my respawn.

    What I did is when the player dies .. the layout will be reset.

    It went well but the HP I still set to 0 when the layout reset.

    Oh btw I have a "MaxHealth" global variable .. if that helps

    I dunno but I'm pretty darn new to the art of making game.

    If someone can offer solution or advice pls do <3

    Thank you

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When you spawn the player set the variable to 100%.

    So it will look like :

    ---------------------------

    ON start of layout - --system--Set health 100

    -------------------------------system--Spawn the actual player sprite at X64 ,Y64

    make sure you poke the value before you spawn the sprite or he will be "still born",and dead on birth.

  • If you have a maxhealth variable I'd use that rather than hardcoding the number per above. That allows you to add extra health for level-ups etc.

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