Commit 6e6b67e0 by BellCodeEditor

save project

parent 996f701e
Showing with 6 additions and 4 deletions
......@@ -18,12 +18,12 @@ body = pygame.image.load('body.png') # 身体
left = pygame.image.load('left.png') # 头 朝左
up = pygame.image.load('up.png') # 头 朝上
down = pygame.image.load('down.png') # 头 朝下
my_foot=pygame.font.Font('neuropol.ttf',21)
x, y = 240, 120
position = [(180, 90), (180, 120), (210, 120), (x, y)]
h_x=360
h_y=300
s=0
setheading = "right"
snake_head = right
......@@ -65,7 +65,7 @@ while True:
else:
position.pop(0)
if x>630 or y>450:
if x>630 or y>450 or x<0 or y<0:
exit()
# 将背景图画上去
screen.blit(background, (0, 0))
......@@ -78,7 +78,8 @@ while True:
# 将果实画上去
screen.blit(food, (h_x, h_y))
info="Screen"+str(screen)
text=my_foot.render(info,Ture,(0,0,0))
text=my_foot.render(info,True,(0,0,0))
screen.blit(text)
# 刷新画面
pygame.display.update()
FPSCLOCK.tick(3)
\ 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