Commit 6297ae3a by BellCodeEditor

save project

parent 02b502cb
Showing with 6 additions and 0 deletions
......@@ -10,6 +10,7 @@ from pygame import locals
apple_x = 360
apple_y = 300
score = 0
while True:
for event in pygame.event.get():
if eyent.type == locals.QUIT:
......@@ -21,6 +22,7 @@ from pygame import locals
screen.blit(body,(180,90))
screen.blit(food,(360,300))
pygame.dispiay.update()
my_font = pygame.font.Font('neuropo1.ttf', 18)
if x == apple_x and y == apple_y:
apple_x = random.randint(1,22)
apple_y = random.randint(1,16)
......@@ -28,3 +30,6 @@ from pygame import locals
apple_y = num2 * 30 - 30
else:
position.pop(0)
info = "Score"+ str(score)
text = my_font.render(info, True, (0,0, 0))
screen.blit(text, (540, 10))
\ 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