pgzero icon indicating copy to clipboard operation
pgzero copied to clipboard

Add clock.time() method

Open tropxy opened this issue 7 years ago • 3 comments

Apparently there is no timer functionality on pgzero, for instance, to record how fast was player 1 to finish the level/game or even time played in general.

I am not sure about where to put this timer, but I guess that it could be added to the Actor class I guess...

tropxy avatar Jul 29 '18 11:07 tropxy

This could be a new built-in. What would the API look like?

lordmauve avatar Jul 29 '18 12:07 lordmauve

I added a get_game_timer which returns the time elapsed since the start of the game in a readable string time format. One can also use other methods in the game_times.py script to do a time alive of an actor.

tropxy avatar Jul 29 '18 13:07 tropxy

We should just add a method to get the current game time out of the clock, i.e. clock.time().

lordmauve avatar Jan 03 '22 09:01 lordmauve