Commit 54e99676 by BellCodeEditor

save project

parent 3bd8f891
Showing with 8 additions and 5 deletions
...@@ -12,6 +12,7 @@ background = pygame.image.load('bg.png') ...@@ -12,6 +12,7 @@ background = pygame.image.load('bg.png')
right = pygame.image.load('right.png') right = pygame.image.load('right.png')
food = pygame.image.load('apple.png') food = pygame.image.load('apple.png')
body = pygame.image.load('body.png') body = pygame.image.load('body.png')
x,y=240,120 x,y=240,120
position=[(180,90),(180,120),(210,120),(x,y)] position=[(180,90),(180,120),(210,120),(x,y)]
...@@ -47,15 +48,16 @@ if event.key == locals.k_LEFT and setheading !="right" ...@@ -47,15 +48,16 @@ if event.key == locals.k_LEFT and setheading !="right"
setheading = left setheading = left
snake_head = left snake_head = left
if event.key == locals.k_DOWN and setheading !="up" if event.key == locals.k_DOWN and setheading !="up"
setheading = DOWN setheading = down
snake_head = DOWN snake_head = down
if event.key == locals.k_UP and setheading !="down" if event.key == locals.k_UP and setheading !="down"
setheading = up setheading = up
snake_head = up snake_head = up
if setheading = "right" if setheading = "right"
snake_head = right
if setheading = "left" if setheading = "left"
snake_head = left
if setheading = "down" if setheading = "down"
snake_head = DOWN
if setheading = "up" if setheading = "up"
snake_head = up
\ No newline at end of file
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