How do I my Meterbar

0 favourites
  • 4 posts
  • Hello there. I just started with a game 'Contra' style (I am a beginner).

    I have a problem with the power bar. If someone could help me with this.. The problem is that while the Player takes an extra life-energy

    then your health bar (PlayerMeterBar) crashes out of the blue window - PlayerMeterBg. Is there any way to make this bar does not extend beyond the border of the blue window?

    Here is example - [attachment=0:37rq90az][/attachment:37rq90az]

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here you go:[attachment=0:escmbjqw][/attachment:escmbjqw]

    The use of a global variable for player health wasn't necessary, so I deleted that. Instead you should've used the instance variable everywhere.

    To the health bar going out of bounds I compared the instance variable to the max and minimal amount possible.

    I've also added the condition is not flashing to the object damaging the player. That way the player doesn't instantly die when hitting/overlapping that object.

  • Thank you very much Mathijs90! I decided to create an energy bar because I hade a lot of problems with the collision with the enemy (I mean "bouncing" from enemy). I think that's the level for advanced people. Thanks a lot for this Fix!

  • You're welcome! Goodluck with your game

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