Skip to content

Instantly share code, notes, and snippets.

@cwalther
Created August 6, 2021 10:34
Show Gist options
  • Save cwalther/3a4e79f99a62281d4b1680cea82ad2ca to your computer and use it in GitHub Desktop.
Save cwalther/3a4e79f99a62281d4b1680cea82ad2ca to your computer and use it in GitHub Desktop.
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