Commit e14a0d36 by BellCodeEditor

save project

parent 786209ac
Showing with 4 additions and 3 deletions
......@@ -25,7 +25,7 @@ apple_x = 360
apple_y = 360
setheading = "right"
snake_head = right
score = 0
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -59,8 +59,8 @@ while True:
# 将背景图画上去
screen.blit(background, (0, 0))
if x == apple_x and y == apple_y:
num1 = random.randint(1,16)
num2 = random.randint(1,16)
apple_x = random.randint(1,16)
apple_y = random.randint(1,16)
apple_x = num1 * 30 - 30
apple_y = num2 * 30 - 30
......@@ -79,3 +79,4 @@ while True:
FPSCLOCK.tick(3)
info = "Score"+ str(score)
text = my_font.render(info, True, (0,0,0))
score.blit
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