I get a problem with the clock.
The following code works:
from PySFML import *
if __name__ == "__main__":
clock = sf.Clock()
print clock.GetElapsedTime()
clock.Reset()
while True:
if clock.GetElapsedTime() >= 10.0:
print "Tick"
clock.Reset()
I followed the same scheme into a class making units and a program havind a drawing part but clock looks staying at this value: 1205263872.0
Here is my function:
if self.clock.GetElapsedTime() >= 10 and len(self.buildingQueue) > 0:
self.parent.addUnit()
self.buildingQueue.pop(0)
self.clock.Reset()
Seconds don't seem to matter, the queue is completely proceeded with no delay. The function is called each frame to check if a unit must be created according to the delay.