Local variable changes on reset

0 favourites
  • 3 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi,

    I have 2 non playable bad sprites each with local variable (health points) = 2

    I have 1 playable sprite also with variable 'playerhealth)' = 2

    I subtract 1 each time a bullet hits them.

    When I reset (go to level 1) the game to allow the player to have bullets back the bad sprites have the correct health, eg: if they were shot before it restarted the level then they only have 1 health, this is perfect and what I want.

    But even if player gets hits and it deducts 1 from his health, when the game resets (go to level 1) he has 2 again!

    Everything seems identical to the bad sprites so I can't work out why the player returns with full health and they others are minus any hits.

    Bad sprites

    Playable player

    Could it be where they are positioned in the events, or sub events?

    Any ideas?

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use persistent behavior on these enemies.

  • THANK YOU SO MUCH!!!! You're a life saver!!!!

    I had persist on the bad guys but didn't on the player, I've just added it and it works perfect.

    Never thought to check that! well done, thank you

    I'm happy now, thanks

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