X-Git-Url: https://git.yukkurigames.com/?p=python-bulletml.git;a=blobdiff_plain;f=bulletml-runner;fp=bulletml-runner;h=d4919886a39b08b30432bc3a8b8081b172e95e71;hp=fc57bcedd82f92929ed28c09b54602d1e668b73c;hb=efb1bac1744eddeb90359cc4d20dc99ce0f6a94a;hpb=181030a9517b3742250dadbf6df7ed633b50831e diff --git a/bulletml-runner b/bulletml-runner index fc57bce..d491988 100755 --- a/bulletml-runner +++ b/bulletml-runner @@ -44,6 +44,7 @@ def main(argv): target.y = (screen.get_height() - target.y) / 2 if not paused or go: + for obj in list(active): new = obj.step() total += len(new) @@ -75,6 +76,15 @@ def main(argv): clock.tick(60) + for event in pygame.event.get(): + if event.type == pygame.QUIT: + raise SystemExit + elif event.type == pygame.KEYDOWN: + if event.key == pygame.K_SPACE: + paused ^= True + elif event.key == pygame.K_RIGHT: + go = True + print " Finished: %04d: %d bullets." % (frames, total) if __name__ == "__main__":