Created
August 6, 2021 10:34
-
-
Save cwalther/3a4e79f99a62281d4b1680cea82ad2ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pew | |
import sys | |
pew.init() | |
def fail(): | |
return [][0] | |
def main(): | |
screen = pew.Pix() | |
screen.box(2, 3, 1, 2, 2) | |
screen.box(3, 5, 3, 2, 2) | |
screen.box(1, 3, 5, 2, 2) | |
pew.show(screen) | |
while pew.keys(): | |
pew.tick(0.1) | |
while True: | |
k = pew.keys() | |
if k == pew.K_UP: | |
print('fail') | |
fail() | |
if k == pew.K_RIGHT: | |
print('GameOver') | |
raise pew.GameOver() | |
if k == pew.K_DOWN: | |
print('exit') | |
sys.exit() | |
if k == pew.K_LEFT: | |
print('return') | |
return | |
pew.tick(0.1) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment