Commit e1ffe331 by BellCodeEditor

save project

parent 139ca2e6
Showing with 11 additions and 9 deletions
......@@ -58,12 +58,13 @@ while True:
if (x,y)==(apple_x,apple_y):
shuax()
score+=1
# os.system('cls')
# print('score:'+str(score))
if (apple_x,apple_y) in pos:
os.system('cls')
print('score:'+str(score))
while (apple_x,apple_y) in pos:
shuax()
else:
pos.pop(0)
pos.pop(0)
if (x,y) in pos[0:-2]:
......@@ -80,14 +81,15 @@ while True:
text = my_font.render(info,True,(0,0,0))
screen.blit(text,(540,10))
pygame.display.update()
if x>660:
(x,y)=(0,y)
if x>630:
x=-30
elif x<0:
(x,y) = (680,y)
x=660
elif y>480:
(x,y) = (x,0)
y=-30
elif y<0:
(x,y) = (x,480)
y=480
FPSCLOCK.tick(3)
......
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