Enemy Life Help

Get help using Construct 2

Post » Sat Aug 24, 2013 12:37 am

Hi guys!

I am trying to develop a Tower defense game for touch devices.



I cant understand this code...help!

THANKS!:)
B
9
S
2
Posts: 82
Reputation: 914

Post » Sat Aug 24, 2013 3:39 am

CurrentHP and MaxHP are both Instance Variables of an object called enemy. Does that help?
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Sat Aug 24, 2013 3:49 am

Thanks!

but way *50?

B
9
S
2
Posts: 82
Reputation: 914

Post » Sat Aug 24, 2013 4:17 am

That's the maximum width it will draw the bar when Current/Max = 1. Everything else is a proportional fraction of that width.
ImageImageImage
B
71
S
21
G
231
Posts: 3,689
Reputation: 129,354

Post » Sat Aug 24, 2013 4:58 am

@blackhornet

THANKS!You have some sample of it like capx.?
so that i have some reference... :)
B
9
S
2
Posts: 82
Reputation: 914

Post » Sat Aug 24, 2013 5:08 am

This is a previous example:
Creating Progress Bars

Event 13 uses the same calculation.blackhornet2013-08-24 05:09:56
ImageImageImage
B
71
S
21
G
231
Posts: 3,689
Reputation: 129,354

Post » Sat Aug 24, 2013 8:15 am

Just in case to clarify a little bit more without looking at the capx:

When life is 1, the bar width will be 50 (50*1=50)
When life is 0.5, the bar width will be 25 (50*0.5=25)
When life is 0, the bar width will be 0 (50*0=0)
B
15
S
6
G
3
Posts: 35
Reputation: 3,982

Post » Sat Aug 24, 2013 8:32 am

@lukedirago

Thanks! I have one more problem is

why my Current/max is at the middle of the monster, instead on the top...


B
9
S
2
Posts: 82
Reputation: 914

Post » Sat Aug 24, 2013 9:13 am

have you set the imagepoint on top of the enemy?
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Sat Aug 24, 2013 10:18 am

@yonda

Yeah!
help... pls :(

Thanks!
B
9
S
2
Posts: 82
Reputation: 914

Next

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 17 guests