health/ scared bar

Get help using Construct 2

Post » Fri Feb 03, 2012 1:14 pm

I was wondering how I can make a bar (kind of like a health bar) that is ticking down very slowly. And when you are in a special area then your bar should be refilled.
Anyone understand?
The goal for the game is to turn on lights so you're not in the dark. because when you're in the dark the scared bar should react.
B
8
S
3
G
2
Posts: 101
Reputation: 2,065

Post » Fri Feb 03, 2012 2:09 pm

Ill (hopefully) point you in the right direction until someone gives you a better answer.

Create a global variable called light and give it a value of 100(or anything).

then start an event -> every 1(or x) seconds
                         -> subtract 1 from light.

(That will make it gradually reduce the light variable).

Make an object. Add event -> on overlap with player
                             ->add 10 to light.

(that will fill it up when the object is stepped on).

Then all you need is to apply darkness based on the number in the light variable.GenkiGenga2012-02-03 14:11:31
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Fri Feb 03, 2012 2:19 pm

Thanks! I will try it
B
8
S
3
G
2
Posts: 101
Reputation: 2,065

Post » Fri Feb 03, 2012 2:27 pm

I have a bar that should resize depending on the global value.. but it doesn't work
B
8
S
3
G
2
Posts: 101
Reputation: 2,065

Post » Fri Feb 03, 2012 2:32 pm

Im by no means an expert, but if you post a cap.x i will take a look.

Worse case scenario i cant help, the cap.x will still let the next person help you easier.
ImageImage
B
74
S
17
G
6
Posts: 1,039
Reputation: 10,605

Post » Fri Feb 03, 2012 2:56 pm

here ya go. I'm not sure what part(s) you needed help with, so please ask specific questions if you have any:

draining health capx
use the arrow keys to move the guy. blue area is the recharge area.lucid2012-02-03 14:57:23
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri Feb 03, 2012 4:56 pm

@Lucid
omg.. that's what I need! You are amazing! thanks thanks thanks
B
8
S
3
G
2
Posts: 101
Reputation: 2,065


Return to How do I....?

Who is online

Users browsing this forum: gregorysforster, jeffige, Matthew de, onzephyr, Yahoo [Bot] and 1 guest