How do I my Meterbar

Get help using Construct 2

Post » Thu Feb 05, 2015 2:19 pm

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 -
Project Baar.rar
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 3
Reputation: 185

Post » Thu Feb 05, 2015 2:59 pm

Here you go:
ProjectBaar_Healthbar_Fix.rar


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.
You do not have the required permissions to view the files attached to this post.
B
12
S
1
G
1
Posts: 34
Reputation: 591

Post » Thu Feb 05, 2015 3:35 pm

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!
B
3
Posts: 3
Reputation: 185

Post » Thu Feb 05, 2015 4:16 pm

You're welcome! Goodluck with your game
B
12
S
1
G
1
Posts: 34
Reputation: 591


Return to How do I....?

Who is online

Users browsing this forum: AkbarAsgharMG, lwgames and 3 guests