Commit 3dd56439 by BellCodeEditor

save project

parent 4532951f
Showing with 9 additions and 2 deletions
...@@ -6,6 +6,10 @@ from pygame import locals ...@@ -6,6 +6,10 @@ from pygame import locals
right = pygame.image.load('right.png') right = pygame.image.load('right.png')
food = pygame.image.load('apple.png') food = pygame.image.load('apple.png')
body = pygame.image.load('body.png') body = pygame.image.load('body.png')
apple_x = 360
apple_y = 300
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if eyent.type == locals.QUIT: if eyent.type == locals.QUIT:
...@@ -16,4 +20,7 @@ from pygame import locals ...@@ -16,4 +20,7 @@ from pygame import locals
screen.blit(body,(180,120)) screen.blit(body,(180,120))
screen.blit(body,(180,90)) screen.blit(body,(180,90))
screen.blit(food,(360,300)) screen.blit(food,(360,300))
pygame.dispiay.update() pygame.dispiay.update()
\ No newline at end of file if x == apple_x and y == apple_y:
apple_x = random.randint(0,660)
apple_y = random.randint(0,480)
\ 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