How do I make Monster HP bigger each time it dies?

0 favourites
  • 3 posts
From the Asset Store
Time rewind like in "Braid". Choose objects that will be affected by time rewind
  • Hi. I am currently learning to use Construct 2 and making a simple shooter by myself. There are 4 levels with a monster in each level.

    Players could choose which monster they would like to fight on the level selection screen. Each time you defeat the monster, it will send you back to the level selection screen. I wanted to make a monster whose HP gets larger each time it dies.

    Here is the scenario. Base of a monster's HP is 100. Each time it dies it increases its HP by 2 times the current amount. This new HP will be used when the player fights the monster again.

    Lets say that if it has already been defeated 3 times, its current HP on the 4th battle would be (((100 X 2) X 2) X 2) = 800 HP

    However, I keep getting stuck after each monster battle as it stops increasing its HP at 200 HP. Is there anyone who could help me with this?

  • Assuming you have a maxhp or monsterlevel GLOBAL variable for each monster (you don't want an instance variable, because that gets lost when the instance is destroyed). It starts at 0.

    Trigger Monster on Death - Increase monsterlevel by one

    On monster created - Set hp to 100*(2^monsterlevel)

    Or

    Trigger Monster on Death - Set maxhp to maxhp*2

    On monster created - Set hp to maxhp

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you very much oosyrag! I can now get a progress on my game.

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