Commit 0323848b by BellCodeEditor

save project

parent a8a04566
Showing with 10 additions and 0 deletions
......@@ -13,10 +13,20 @@ body = pygame.image.load('body.png')
x=60
y=420
pos=[(60,360),(60,390),(60,420),(x,y)]
head='right'
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
if event.type == locals.KEYDOWN:
if event.key==K_RIGHT and head!='left':
head='right'
if event.key==K_RIGHT and head!='right':
head='left'
if event.key==K_RIGHT and head!='down':
head='up'
if event.key==K_RIGHT and head!='up':
head='down'
x+=30
pos.append((x,y))
pos.pop(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment