Damage numbers

For questions about using Classic.

Post » Mon Feb 10, 2014 4:28 am

I tried using the text object for damage numbers but when I hit more than multiple monsters the text becomes absolutely black.
I also used SpriteFont plugin but it's bugged as creating more spritefont objects will spawn in higher positions than wanted and also theirs no action to set opacity
Are there any examples that can use sprite text and can fade away as well and the best way so that the games won't lag.

Thanks
B
14
S
2
G
1
Posts: 46
Reputation: 1,144

Post » Sun Feb 16, 2014 2:18 am

anyone?
B
14
S
2
G
1
Posts: 46
Reputation: 1,144

Post » Sun Feb 16, 2014 5:29 pm

Hmm, that's a tricky one. You may want to make a custom numbering system out of sprites (0 to 9).
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit
B
113
S
39
G
17
Posts: 2,184
Reputation: 19,217

Post » Sun Feb 16, 2014 5:43 pm

i know but how to make it work?
B
14
S
2
G
1
Posts: 46
Reputation: 1,144

Post » Tue Feb 18, 2014 5:25 am

i cant figure out how to put them together, i tried using hashtable and other plugins.
B
14
S
2
G
1
Posts: 46
Reputation: 1,144

Post » Wed Feb 19, 2014 12:15 am

Maybe this older blog article can help:

Bitmap font damage
B
22
S
6
G
10
Posts: 1,034
Reputation: 7,514

Post » Wed Feb 19, 2014 10:53 pm

I had the same problem with hitting multiple enemies, except I got some different bugs, but I think this solution should help.

What I did was make it so that when you hit an enemy, for each enemy, a variable "hit" changes to 1 and then a function "damaged" is called.
On the function "damaged" you would select the enemy that has "hit" equal to 1 and then spawn your damage numbers and whatever other effects that you need to apply.

When you finish spawning the numbers, you set "hit" to zero and then you're good to go.

So basically, as your weapon hits each enemy, even if it hits multiple ones, it should go through each enemy, one by one, and then spawn the number and then move on to the next without duplicating the numbers.

Hope this helps
B
12
S
2
Posts: 32
Reputation: 856

Post » Thu Feb 20, 2014 6:06 pm

Hey,
There is an awesome little piece of software I believe somebody created on this forum called something similar to "GiveYourFontsMono", you can use that to generate a Spritefont for you. Using the options within the software, you can leave space around the edges of the SpriteFont, and then you could draw an outline around them (so white font, black outline). Some software does this for you :P
The other way, you could program it in which gets a bit fiddly to explain. You would have a Sprite called "Digit", in which each frame is the image for the number (Frame 0 = 0, Frame 1 = 1, all the way to 9), and you could slap the Bullet and Fade behaviour onto it so it moves and fades away, then you just gotta do a slightly complicated few events in order to position the numbers correctly according to the damage (This is really finicky to do, I totally recommend Spritefont).
B
51
S
20
G
10
Posts: 571
Reputation: 9,819


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests