Commit 16f7d2ab by BellCodeEditor

save project

parent fd6cbcdf
Showing with 5 additions and 2 deletions
...@@ -4,17 +4,20 @@ from pygame import locals ...@@ -4,17 +4,20 @@ from pygame import locals
pygame.init() pygame.init()
# 创建一个窗口 # 创建一个窗口
screen=pygame.display.set_mode((660,480)) screen=pygame.display.set_mode((660,480))
FPSCLOCK=pygame.time.Clock()
a=pygame.image.load('bg.png') a=pygame.image.load('bg.png')
b=pygame.image.load('right.png') b=pygame.image.load('right.png')
c=pygame.image.load('apple.png') c=pygame.image.load('apple.png')
d=pygame.image.load('body.png') d=pygame.image.load('body.png')
x,y=240,180
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type==locals.QUIT: if event.type==locals.QUIT:
exit() exit()
x+=30
screen.blit(a,(0,0)) screen.blit(a,(0,0))
screen.blit(b,(240,180)) screen.blit(b,(x,y))
screen.blit(c,(240,120)) screen.blit(c,(240,120))
screen.blit(d,(210,180)) screen.blit(d,(210,180))
pygame.display.update() pygame.display.update()
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