Commit e4a627b8 by BellCodeEditor

save project

parent 10d29083
Showing with 23 additions and 16 deletions
...@@ -3,25 +3,32 @@ from pygame import locals ...@@ -3,25 +3,32 @@ from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
# 创建一个窗口 x,y = (240,120)
h=pygame.display.set_mode((660,480)) clock = pygame.time.Clock()
bg=pygame.image.load('bg.png')
right=pygame.image.load('right.png')
apple=pygame.image.load('apple.png')
body=pygame.image.load('body.png')
h.blit(bg,(0,0))
h.blit(right,(240,120))
h.blit(body,(210,120))
h.blit(body,(180,120))
h.blit(body,(180,90))
h.blit(apple,(300,300))
while True: while True:
pygame.display.update() x += 30
for a in pygame.event.get(): for a in pygame.event.get():
if a.type == locals.QUIT: if a.type == locals.QUIT:
exit() exit()
clock.tick(3)
\ No newline at end of file
# 创建一个窗口
h=pygame.display.set_mode((660,480))
bg=pygame.image.load('bg.png')
right=pygame.image.load('right.png')
apple=pygame.image.load('apple.png')
body=pygame.image.load('body.png')
h.blit(bg,(0,0))
h.blit(right,(x,y))
h.blit(body,(210,120))
h.blit(body,(180,120))
h.blit(body,(180,90))
h.blit(apple,(300,300))
pygame.display.update()
\ 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