def main(): clock.schedule(rabbyt.add_time) window.game_window = Window(width=SCREEN_WIDTH, height=SCREEN_HEIGHT) rabbyt.set_default_attribs() mower = Mower() bubble = RPMBubble() guage = Guage(mower) objs = [mower, guage, bubble] magicEventRegister(window.game_window, events, objs) while not window.game_window.has_exit: tick = clock.tick() window.game_window.dispatch_events() for obj in objs: obj.update(tick) events.ConsumeEventQueue() rabbyt.clear((1, 1, 1)) guage.draw() mower.draw() bubble.draw() window.game_window.flip()
def main(): global win clock.schedule(rabbyt.add_time) win = Window(width=800, height=600) rabbyt.set_default_attribs() lawn = Lawn() wind = Wind() magicEventRegister(win, events, list(lawn)) while not win.has_exit: tick = clock.tick() win.dispatch_events() lawn.update(tick) wind.update(tick) events.ConsumeEventQueue() rabbyt.clear((1, 1, 1)) lawn.draw() win.flip()
def main(): clock.schedule(rabbyt.add_time) window.game_window.set_window(Window(width=800, height=600)) rabbyt.set_default_attribs() bgPat = pyglet.image.SolidColorImagePattern((0, 0, 0, 255)) bg = pyglet.image.create(window.game_window.width, window.game_window.height, bgPat) bub = ThoughtBubble( "Click to make this disappear." " This is a thought bubble." " asdf asdf .qwer p30n fpin pp) ) *HNPO *H#NN ! #RFL" ) bub2 = HintBubble("This is a hint bubble.") maker = BubbleMaker() magicEventRegister(window.game_window, events, [bub]) counter = 0 objects = [bub, bub2, maker] events.Fire("Shoo", 1, 2, None) while not window.game_window.has_exit: tick = clock.tick() window.game_window.dispatch_events() counter += tick if counter > 8: counter = -10 events.Fire("NewThought", "new thought") events.Fire("Shoo", 3, 4, None) for obj in objects: obj.update(tick) events.ConsumeEventQueue() rabbyt.clear((1, 1, 1)) bg.blit(0, 0) for obj in objects: obj.draw() window.game_window.flip()
def main(): global win clock.schedule(rabbyt.add_time) win = pyglet.window.Window(width=SCREEN_WIDTH, height=SCREEN_HEIGHT) window.set_window(win) rabbyt.set_default_attribs() bubbles.init() bubbles.win = win storyTeller = narrative.StoryTeller() wind = Wind() leafgen = LeafGenerator() leafgen.active = True leaves = LeafGroup() #bg = sky.Background(None) objs = [leafgen, leaves] magicEventRegister(win, events, objs) while not win.has_exit: tick = clock.tick() win.dispatch_events() bubbles.bubbleMaker.update(tick) #bg.update(tick) for obj in objs: obj.update(tick) wind.update(tick) events.ConsumeEventQueue() rabbyt.clear((1, 1, 1)) #bg.draw() leaves.draw() bubbles.bubbleMaker.draw() win.flip()