Re: [pygame] timer callback into object?

2017-02-10 Thread René Dudfield
Hey ya, so... a few ways. # First threading. It's not so quick with threads, and delay can be longer than you hope. # https://docs.python.org/3/library/threading.html#threading.Timer from threading import Timer def hello(): print("hello, world") seconds = 1.0 Timer(seconds, hello).start() #

[pygame] timer callback into object?

2017-02-10 Thread Irv Kalb
I've been working on porting a game that I wrote in a different language/environment, and I want to make the Python/PyGame code as efficiently as possible. I have code in an object, that triggers an event that should occur, say 1 second later. I used pygame.set_timer, created an ID and set 1