Animated Text/Score Board

Get help using Construct 2

Post » Sat May 04, 2013 7:02 am

Hey everyone!

I am trying to make an animated counter. One you would normally see at the end of a video game. I started with this code in the shot below but going up by one is far to slow. If I go up by ten or a hundred I lose the full effect of the numbers flashing. Can anyone help or seen this done? Thanks!

B
50
S
14
G
12
Posts: 813
Reputation: 16,764

Post » Sat May 04, 2013 8:09 am

Why don't you try Every X seconds (X could be 0.2 for exemple)
https://www.scirra.com/forum/viewtopic.php?t=152506

And that is why you shall respect the bug reports guidelines, not only giving a capx is making the bug reproductible in one click in a situation they can work with (less time wasted trying to reproduce vague instructions) but also it helps filtering false positives.

Game design is all about decomposing the core of your game so it becomes simple instructions.
B
42
S
17
G
16
Posts: 2,094
Reputation: 15,355

Post » Sat May 04, 2013 10:15 am

Since you're displaying text every tick, try using dt instead of a solid number.

You'll probably want 2 variables: Score and Score_Display. Then when Score is greater than Score_Display, have it add 100*dt to Score_Display.

This way, the text shows the Score_Display variable every tick, and every tick it constantly adds to the variable until the score is the same.
B
15
S
4
G
4
Posts: 294
Reputation: 3,225

Post » Sat May 04, 2013 11:42 am

[QUOTE=Thndr] Since you're displaying text every tick, try using dt instead of a solid number.

You'll probably want 2 variables: Score and Score_Display. Then when Score is greater than Score_Display, have it add 100*dt to Score_Display.

This way, the text shows the Score_Display variable every tick, and every tick it constantly adds to the variable until the score is the same.[/QUOTE]

So far this is what I have come up with. But its not giving the desired effect. Is this what you mean?

B
50
S
14
G
12
Posts: 813
Reputation: 16,764

Post » Sat May 04, 2013 11:55 am

Here's an example of displaying the score over a fixed amount of time. It doesn't matter if the score is 100 or 10000000 it will be count up from 0 to score over 2 seconds (or whatever value you set).
fixedTimeScoreDisplay.capx
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Sun May 05, 2013 8:58 am

Hmm, complicated math there but I love it! Thank you so much.
B
50
S
14
G
12
Posts: 813
Reputation: 16,764

Post » Fri Jul 24, 2015 3:40 pm

Message: sandronize can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hi, I was play around with your capx , but i can't come up with it.

I added on keyboard pressed add 50 do score
but when i press again the counter restart from zero wich is the timer value
I tried to put timer value = score but doesent work

can you take a look?
thanks
https://www.dropbox.com/s/om42fyeltk2p4 ... .capx?dl=0
B
6
S
1
Posts: 52
Reputation: 539


Return to How do I....?

Who is online

Users browsing this forum: farfetchd83, makkancs and 27 guests