Commit c70c59da by BellCodeEditor

save project

parent d2bb2232
Showing with 9 additions and 9 deletions
...@@ -5,18 +5,18 @@ pygame.init() ...@@ -5,18 +5,18 @@ pygame.init()
# 创建一个窗口 # 创建一个窗口
screen=pygame.display.set_mode((660,480)) screen=pygame.display.set_mode((660,480))
background=pygame.image.load("bg.png") background=pygame.image.load("bg.png")#载入背景图片
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")#载入身体图片
while True: while True:
screen.blit(background,(0,0)) screen.blit(background,(0,0))#画上背景
screen.blit(right,(240,120)) screen.blit(right,(240,120))#画上右头
screen.blit(body,(210,120)) screen.blit(body,(210,120))#画上身体
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.display.update() pygame.display.update()#刷新画面
for event in pygame.event.get():#遍历玩家事件 for event in pygame.event.get():#遍历玩家事件
if event.type ==locals.QUIT:#检测玩家是否按下退出 if event.type ==locals.QUIT:#检测玩家是否按下退出
exit() exit()
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