Commit 4f782b32 by BellCodeEditor

save project

parent 7c1f6a67
Showing with 27 additions and 1 deletions
......@@ -13,7 +13,33 @@ while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
x+=30
if event.type==locals.KEYDOWN:
if event.key==locals.K_RIGHT and staticmethod !="left"
staticmethod='right'
snake_head=right
if event.key==locals.K_RIGHT and staticmethod !="right"
staticmethod='left'
snake_head=left
if event.key==locals.K_UP and staticmethod !="down"
staticmethod='up'
snake_head=up
if event.key==locals.K_DOWN and staticmethod !="up"
staticmethod='down'
snake_head=down
if setheaing=="right":
x += 30
if setheaing=="left":
x +=-30
if setheaing=="up":
y += 30
if setheaing=="down":
y +=-30
position.append((x,y))
position.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