Click counter

Get help using Construct 2

Post » Mon Feb 02, 2015 5:03 pm

All of you should know the game "cookie clicker".
How do i count the taps per second?
Read this:
yeah, i really like to say that you should "Read this:"
B
12
S
5
Posts: 138
Reputation: 1,490

Post » Mon Feb 02, 2015 5:13 pm

Taps per second should equal the total number of taps divided by the time elapsed in seconds.

If the user has clicked 120 times in 60 seconds, 120/60 is 2, 2 taps per second.
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,826

Post » Mon Feb 02, 2015 5:23 pm

but that would be the taps calculated with a minute timer,
i want to know like how fast is he tapping per second right now, if he stops tapping the counter should get to zero and if he starts tapping again it should show something like 10taps/sec
Read this:
yeah, i really like to say that you should "Read this:"
B
12
S
5
Posts: 138
Reputation: 1,490

Post » Mon Feb 02, 2015 5:51 pm

Use two variables -> LastTPS and CurrentTPS
Add a "Every 1.0s" -> set LastTPS to CurrentTPS, -> Set CurrentTPS to 0
On tap -> Add 1 to CurrentTPS

And use LastTPS to display what "Taps per second" he's currently getting (albeit with a slight 1 second delay).
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Mon Feb 02, 2015 6:08 pm

works really nice, thank you :)
Read this:
yeah, i really like to say that you should "Read this:"
B
12
S
5
Posts: 138
Reputation: 1,490

Post » Wed Dec 23, 2015 10:38 am

you can do the same with every0.25s and update 4 times per second
display tps*4 to show the taps per second even though it updates 4 times/s
B
4
Posts: 2
Reputation: 204


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest