示例#1
0
文件: app.py 项目: thp/pyweek15
 def update(self, callback):
     now = time.time()
     self.accumulated += (now - self.last_time)
     self.last_time = now
     while self.accumulated > self.step:
         self.accumulated -= self.step
         callback()
示例#2
0
    def setUpClass(cls):
        arrival_count = 20
        earliest_arrival_time = time.time(8, 0)  # 8:00
        latest_arrival_time = time.time(22, 59)  # 22:59
        turn_around_time = 1 * time.HOUR
        min_connection_time = 30 * time.MINUTE
        max_items_per_transfer = 5

        cls._generator = TransferGenerator(
            arrival_count,
            earliest_arrival_time,
            latest_arrival_time,
            turn_around_time,
            min_connection_time,
            max_items_per_transfer,
        )
示例#3
0
文件: renderer.py 项目: thp/pyweek15
 def render_effect(self, effect, fbo):
     effect.draw_quad(
         fbo.texture, [-1, -1, -1, 1, 1, -1, 1, 1], {
             'time': (time.time() - self.started) % 314.1592653589793,
             'size': (fbo.texture.w, fbo.texture.h),
         })
示例#4
0
文件: renderer.py 项目: thp/pyweek15
 def __init__(self, app):
     self.app = app
     self.postprocessed = False
     self.global_tint = 1., 1., 1.
     self.started = time.time()
示例#5
0
文件: app.py 项目: thp/pyweek15
 def __init__(self, fps):
     self.step = 1. / float(fps)
     self.accumulated = 0
     self.last_time = time.time()