How do I gradually increase the Numbers in text?

Get help using Construct 2

Post » Fri Sep 15, 2017 9:51 am

Guys, so for example we have a text of 10 and if i click a sprite the 10 should increase to 15. but not immediately, it should increase like 11,12,13,14,15 . Any ways to achieve this, thanks. :D :D :roll:
B
5
S
1
Posts: 17
Reputation: 361

Post » Fri Sep 15, 2017 10:19 am

Lots of ways to achieve this. You can start a Timer and every On Timer event increase your text by 1 until it =15.

Or you can use Sine or LiteTween behavior with "Movement=Value". On "Sine->Is Active" event change your text with the Sine.value
I recommend LiteTween behavior, you can make cool speeding/slowing down effects.
Check out my awesome game Doptrix
B
17
S
8
G
9
Posts: 195
Reputation: 6,379

Post » Fri Sep 15, 2017 1:42 pm

i tried what you said using the LiteTween behavior but it seemed to have random numbers in decimals, could you perhaps help me out with the exact events . Thank you.
B
5
S
1
Posts: 17
Reputation: 361

Post » Fri Sep 15, 2017 1:58 pm

This will change text from 10 to 50 with slowing down effect.
Image

Here you can see how all LiteTween functions work:
http://easings.net/
Check out my awesome game Doptrix
B
17
S
8
G
9
Posts: 195
Reputation: 6,379

Post » Fri Sep 15, 2017 2:11 pm

yes i tried this logic out and after it hits 50 it goes back to 0, what seems to be the error here, Thanks
B
5
S
1
Posts: 17
Reputation: 361

Post » Fri Sep 15, 2017 2:13 pm

Hey @sublimate!

The capx below shows a simple step-by-step increment. Every time you click the button it will add 5, 1 by 1, to the number. You can set the total increment and the speed by changing instance variables totalIncrease and increaseInterval respectively.

https://www.dropbox.com/s/ipp9peqinp4o5 ... .capx?dl=0

Hope it helps. Cheers!
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
16
S
4
G
1
Posts: 428
Reputation: 2,337

Post » Fri Sep 15, 2017 2:26 pm

sublimate wrote:yes i tried this logic out and after it hits 50 it goes back to 0, what seems to be the error here, Thanks

You did something wrong (probably set Start Mode to "Ping Pong").
Just copy tween settings from my screenshot, they work correctly.
Check out my awesome game Doptrix
B
17
S
8
G
9
Posts: 195
Reputation: 6,379

Post » Fri Sep 15, 2017 2:40 pm

yes it works right in a test variable, however the "Target " has been pre-set to 40 whereas i need it to be dynamic and needs to increase by 5 with each click.
B
5
S
1
Posts: 17
Reputation: 361

Post » Fri Sep 15, 2017 5:48 pm

You can set/change the Target and all other settings for the LiteTween with events. It's a powerful behavior once you learn how it works.
Check out my awesome game Doptrix
B
17
S
8
G
9
Posts: 195
Reputation: 6,379

Post » Sat Sep 16, 2017 4:03 am

I understand you want to animate your scores?
I made a small demo:
Tween Demo

CAPX
Check out my awesome game Doptrix
B
17
S
8
G
9
Posts: 195
Reputation: 6,379


Return to How do I....?

Who is online

Users browsing this forum: DharmaOne, namaewayukidesu and 15 guests