Commit fe2234f9 by BellCodeEditor

save project

parent 95b1e684
Showing with 23 additions and 0 deletions
......@@ -6,6 +6,14 @@ pygame.init()
# 创建一个窗口
Screen = pygame.display.set_mode((660,480))
#载入背景图片
bg = pygame.image.load("bg.png")
#载入蛇头图片
right = pygame.image.load("right.png")
#载入身体图片
body = pygame.image.load("body.png")
#载入苹果图片
apple = pygame.image.load("apple.png")
#无限循环让窗口一直保留
while True:
......@@ -15,3 +23,17 @@ while True:
if event.type == locals.QUIT:
#退出程序
exit()
#加载背景图片
Screen.blit(bg,(0,0))
#加载蛇头
Screen.blit(right,(180,120))
#加载身体
Screen.blit(body,(150,120))
Screen.blit(body,(120,120))
Screen.blit(body,(120,90))
#加载苹果
Screen.blit(apple,(450,360))
#实时刷新画面
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