Python Forum
Accurate Clicks Per Second
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accurate Clicks Per Second
#1
Hiya guys. It's been a while and this place has changed a bit. Well, I'm working on a clicker-style game and I need an accurate way to calculate clicks per second (cps). I've sort of hard-coded a simple way of doing it, but I find it isn't as accurate.

Code:

///===CREATE EVENT===///
taps=0;// number of taps/clicks player makes
frames=0;// initial time keeping variable
sec=0;// conversion from frames to seconds
taps_per_sec=0;// how many taps/clicks per second

///===STEP EVENT===///
//...increase time
frames += 1;

//...convert time (frames) to sec (seconds)
sec = frames / room_speed;

//...find tps
taps_per_sec = ceil(taps / sec);

///===ALARM 0===///
// Each time the player clicks the alarm is reset to room_speed and taps is 
// increased by 1
///...reset
taps=0;
frames=0;
taps_per_sec=0;
This works a okay, but I'm in need of a more accurate method. This is where algebra comes in and I stink at creating algebraic equations. Maybe if there is a time stamp of each click and then calculating the time in between clicks, like the pneumatic road tubes calculating car speed. I don't know. I'm kind of stuck here though so any help would be appreciated.
Reply


Messages In This Thread
Accurate Clicks Per Second - by JudyLarose - Jun-13-2020, 01:48 PM
RE: Accurate Clicks Per Second - by michael1789 - Jun-13-2020, 05:06 PM
RE: Accurate Clicks Per Second - by Windspar - Jun-13-2020, 09:29 PM
RE: Accurate Clicks Per Second - by JudyLarose - Jun-14-2020, 05:04 AM
RE: Accurate Clicks Per Second - by buran - Jun-14-2020, 05:49 AM
RE: Accurate Clicks Per Second - by maxwilson - Feb-09-2021, 07:33 PM
RE: Accurate Clicks Per Second - by deanhystad - Feb-09-2021, 09:03 PM
RE: Accurate Clicks Per Second - by maxwilson - Feb-10-2021, 02:54 AM
RE: Accurate Clicks Per Second - by deanhystad - Feb-10-2021, 03:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Accurate Clicks Per Second Hamti 6 4,261 May-18-2024, 06:24 AM
Last Post: wordtime
  [split] Accurate Clicks Per Second kathyalex 4 3,278 Feb-16-2021, 04:27 PM
Last Post: SheeppOSU
  help with python mouse clicks and Pygame programmer229193 5 3,014 May-05-2020, 04:15 PM
Last Post: Windspar
  [PyGame] How would I make my position variable more accurate? HelpMEE 4 3,075 Dec-31-2019, 02:31 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020