Show EnemyStats

Get help using Construct 2

Post » Sun Sep 08, 2013 5:36 am

I've got a platformer level, and I have multiple enemies on the level. What I'd like to do is when I press the letter D, it will toggle a debug mode, where next to each enemy will be a block of text showing some basic stats would show up.

How would I go about setting up these blocks of text so they'd be pertinent for the enemy it's attached to (if that's even the correct terminology).

I imagine I'd have to have a text object, and on the startup of the layout, loop through these enemy instances, create a new instance of the text block next to each enemy. But how do I ensure the block of text contains the values for the specific enemy?wizaerd2013-09-08 05:36:42
B
14
S
6
G
1
Posts: 143
Reputation: 1,800

Post » Sun Sep 08, 2013 7:18 am

Nevermind, I believe I got it...
B
14
S
6
G
1
Posts: 143
Reputation: 1,800

Post » Sun Sep 08, 2013 8:28 am

How to do that?
B
9
S
2
Posts: 82
Reputation: 914

Post » Sun Sep 08, 2013 8:32 am

Containers, I think.
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Sun Sep 08, 2013 9:06 am

No, I really don't know anything about containers, and I don't know if I'm doing this right, but it works. On the layout startup I iterate through all enemies and create a txtStat object, and assign the UID to the specific enemy. On every system tick, if the global variable DEBUGMODE is true, then I write a series of text strings to the appropriate txtStats object by selecting it via the enemey statsInstance variable. If DEBUGMODE is False, then it just iterates through all the stats text objects turning them invisible.

startup
Tick
B
14
S
6
G
1
Posts: 143
Reputation: 1,800


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 22 guests