Commit 23edd1b5 by BellCodeEditor

save project

parent 89d91c9c
Showing with 12 additions and 5 deletions
...@@ -31,16 +31,23 @@ while True: ...@@ -31,16 +31,23 @@ while True:
if event.key == locals.k_RIGHT and setheadin !="left": if event.key == locals.k_RIGHT and setheadin !="left":
setheadin = 'right' setheadin = 'right'
snake_head=right snake_head=right
if event.key == locals.k_RIGHT and setheadin !="right": if event.key == locals.k_RIGHT and setheadin !="right":
setheadin = 'right' setheadin = 'right'
snake_head=right snake_head=right
if event.key == locals.k_RIGHT and setheadin !="down": if event.key == locals.k_RIGHT and setheadin !="down":
setheadin = 'up' setheadin = 'up'
snake_head=up snake_head=up
if event.key == locals.k_RIGHT and setheadin !="up": if event.key == locals.k_RIGHT and setheadin !="up":
setheadin = 'down' setheadin = 'down'
snake_head=down snake_head=down
x +=30 if setheadin == "right":
x+=30
if setheadin == "left":
x-=30
if setheadin == "up":
y-=30
else
y+=30
position.append((x,y)) position.append((x,y))
position.pop(0) position.pop(0)
screen.blit(background, (0, 0)) screen.blit(background, (0, 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