Cheapest way to show hit damage text?

Get help using Construct 2

Post » Fri Nov 23, 2012 1:42 pm

Hi constructers,
I'm very new here and I'm making a prototype of action RPG.
Now I want to display a HP damage text when player hit or get hit enemies. very typical example is Final Fantasy.
I wonder whats the cheapist way at performance wise? my first idea is to spawn a text object shows the damage amount, move upwards then destroy it?
B
14
S
2
G
1
Posts: 94
Reputation: 2,089

Post » Fri Nov 23, 2012 1:48 pm

That's how I will do it too, not sure about the cheapness though...ZhaoYun2012-11-23 13:48:44
B
12
S
4
G
4
Posts: 64
Reputation: 4,014

Post » Fri Nov 23, 2012 1:58 pm

Optimisation: don't waste your time.

Instead of destroying the text object you can consider to set it invisible and reuse it later to display other datas.
Anyway, C2 recycle objects for us, so it doesn't even really matter in the end.

As long as your computer can make it run, consider that it's good and working and that your current machine can be used as "least required hardware the game will execute properly on".
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Fri Nov 23, 2012 2:10 pm

Make a text object named DamageDisplay. I would give it a fade behavior with about 2.5 seconds of fade out time, also set it to destroy after fade. THEN.

Make a new event such as
- Bullet collides with Enemy (or whatever is your attack)
-> Create new DamageDisplay at Enemy.X Enemy.Y-20
-> Set Text to DamageDealt
-> Wait 2 seconds
-> DamageDisplay start fadeEncryptedCow2012-11-23 14:12:56
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Fri Nov 23, 2012 2:49 pm

Thanks:D


I have tried either way, seems the text is pretty cheap anyway is it doesn't matter set visiblity or creat/destory. It really depends on what effect you want achieve. Fade behavior is also cool!
B
14
S
2
G
1
Posts: 94
Reputation: 2,089


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests