Commit 18eddde1 by BellCodeEditor

auto save

parent aad026ae
Showing with 11 additions and 2 deletions
...@@ -17,13 +17,18 @@ left = pygame.image.load('left.png') ...@@ -17,13 +17,18 @@ left = pygame.image.load('left.png')
right = pygame.image.load('right.png') right = pygame.image.load('right.png')
up= pygame.image.load('up.png') up= pygame.image.load('up.png')
down = pygame.image.load('down.png') down = pygame.image.load('down.png')
wcnm=pygame.font.Font('neuropol.ttf',18)
x,y=210,120 x,y=210,120
a,b=300,360 a,b=300,360
zuobiao=[(180,90),(180,120),(210,120),(x,y)] zuobiao=[(180,90),(180,120),(210,120),(x,y)]
setheading="right" setheading="right"
zaoxin=right zaoxin=right
f=0
while True: while True:
if x<30 or y<30 or x>630 or y>450:
exit()
if x==a and y== b: if x==a and y== b:
f+=1
a=random.randint(0,630) a=random.randint(0,630)
b=random.randint(0,450) b=random.randint(0,450)
cctv=a%30 cctv=a%30
...@@ -60,7 +65,11 @@ while True: ...@@ -60,7 +65,11 @@ while True:
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(food, (a, b)) screen.blit(food, (a, b))
screen.blit(zaoxin, zuobiao[-1]) screen.blit(zaoxin, zuobiao[-1])
inff="Score"+str(f)
text=wcnm.render(inff,True,(0,255,255))
screen.blit(text,(540,10))
for i in range(len(zuobiao)-1): for i in range(len(zuobiao)-1):
screen.blit(body,zuobiao[i]) screen.blit(body,zuobiao[i])
for i in zuobiao:
pygame.display.update() pygame.display.update()
FPSLOCK.tick(5) FPSLOCK.tick(10)
\ No newline at end of file \ 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