diff options
author | rcoh <rcoh@mit.edu> | 2011-01-24 22:44:16 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-01-24 22:44:16 -0500 |
commit | 2019fb2895237aa9d86450daaf6d90831189fc13 (patch) | |
tree | 6dd9de45c5c2994c0a6aad2aa808092abb8f99bd /LightInstallation.py | |
parent | 39de2bc415e6dc02c68018655962197a38207718 (diff) |
Some new stuff. Fixed a bug where screen responses weren't being synchronized. Now they are.
Added XYMove to do a bouncy behavior.
Diffstat (limited to 'LightInstallation.py')
-rw-r--r-- | LightInstallation.py | 8 |
1 files changed, 4 insertions, 4 deletions
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: |