Commit 28fc7b0b by BellCodeEditor

save project

parent ab463cff
Showing with 2 additions and 2 deletions
...@@ -21,10 +21,9 @@ x, y = 240, 120 ...@@ -21,10 +21,9 @@ x, y = 240, 120
position = [(180, 90), (180, 120), (210, 120), (x, y)] position = [(180, 90), (180, 120), (210, 120), (x, y)]
apple_x=360 apple_x=360
apple_y=300 apple_y=300
setheading = "right" setheading = "right"
snake_head = right snake_head = right
score=0
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -57,6 +56,7 @@ while True: ...@@ -57,6 +56,7 @@ while True:
if x==apple_x and y==apple_y: if x==apple_x and y==apple_y:
apple_x= random.randrange(0,660,30) apple_x= random.randrange(0,660,30)
apple_y= random.randrange(0,480,30) apple_y= random.randrange(0,480,30)
score=score+100
else: else:
position.pop(0) 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