Commit f16f3c88 by BellCodeEditor

save project

parent 0cd4016d
Showing with 14 additions and 4 deletions
......@@ -7,17 +7,27 @@ backgruond = pygame.image.load('bg.png')
right = pygame.image.load('right.png')
food = pygame.image.load('apple.png')
body = pygame.image.load('body.png')
left = pygame.image.load('left.png')
# 创建一个窗口
FPSCLOCK = pygame.time.Clock()
x,y = 240,120
screen = pygame.display.set_mode((800,600))
while True:
for event in pygame.event.get():
if event.type == locals.QUIT: #12
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_DOWN:
y+=30
x+=30
screen.blit(backgruond,(0,0))
screen.blit(right,(240,120))
screen.blit(right,(x,y))
screen.blit(food,(360,300))
pos = [(210+30,120),(180,120),(180,150)]
pos = [(x-30,y),(x-60,y),(x-90,y)]
for i in pos:
screen.blit(body,i)
pygame.display.update()
\ No newline at end of file
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