From 2019fb2895237aa9d86450daaf6d90831189fc13 Mon Sep 17 00:00:00 2001 From: rcoh Date: Mon, 24 Jan 2011 22:44:16 -0500 Subject: Some new stuff. Fixed a bug where screen responses weren't being synchronized. Now they are. Added XYMove to do a bouncy behavior. --- LightInstallation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'LightInstallation.py') diff --git a/LightInstallation.py b/LightInstallation.py index 62d3f6a..b582bd2 100644 --- a/LightInstallation.py +++ b/LightInstallation.py @@ -146,19 +146,19 @@ class LightInstallation(object): def mainLoop(self): lastLoopTime = clock.time() refreshInterval = 30 - runCount = 2000 - while runCount > 0 and not self.dieNow: - runCount -= 1 + while not self.dieNow: loopStart = clock.time() responses = self.evaluateBehaviors() #inputs are all queued when they #happen, so we only need to run the behaviors self.timer.start() [self.screen.respond(response) for response in responses if response != []] - self.screen.timeStep() + self.screen.timeStep(loopStart) [r.render(self.screen, loopStart) for r in self.renderers] loopElapsed = clock.time()-loopStart sleepTime = max(0,refreshInterval-loopElapsed) + main_log.debug('Loop complete in ' + str(loopElapsed) + 'ms. Sleeping for ' +\ + str(sleepTime)) self.timer.stop() #print self.timer.elapsed() if sleepTime > 0: -- cgit v1.2.3