@@ -0,0 +1,1516 @@
+from thecure import get_engine%0A%0A%0Aclass Timer(object):%0A    def __init__(self, ms, cb, one_shot=False):%0A        self.engine = get_engine()%0A        assert self.engine%0A%0A        self.ms = ms%0A        self.cb = cb%0A        self.tick_count_count = 0%0A        self.started = False%0A        self.paused_for_ms = 0%0A        self.unpause_cb = None%0A        self.one_shot = one_shot%0A        self.tick_cnx = None%0A%0A        if ms %3E 0:%0A            self.start()%0A%0A    def start(self):%0A        if not self.started:%0A            self.tick_count = 0%0A            self.paused_for_ms = 0%0A            self.unpause_cb = None%0A            self.tick_cnx = self.engine.tick.connect(self.on_tick)%0A            self.started = True%0A%0A    def reset(self):%0A        self.tick_count = 0%0A        self.paused_for_ms = 0%0A        self.unpause_cb = None%0A%0A        if self.ms %3E 0:%0A            self.start()%0A%0A    def stop(self):%0A        if self.started:%0A            self.tick_cnx.disconnect()%0A            self.tick_cnx = None%0A            self.started = False%0A%0A    def pause(self, ms, unpause_cb):%0A        self.paused_for_ms = ms%0A        self.unpause_cb = unpause_cb%0A        self.tick_count = 0%0A%0A    def on_tick(self):%0A        self.tick_count += 1.0 / self.engine.FPS * 1000%0A%0A        if self.paused_for_ms %3E 0 and self.tick_count %3E= self.paused_for_ms:%0A            self.paused_for_ms = 0%0A            self.unpause_cb()%0A        elif self.tick_count %3E= self.ms:%0A            self.tick_count = 0%0A            self.cb()%0A%0A            if self.one_shot:%0A                self.stop()%0A

Add a Timer object.