Commit e9771b77 by BellCodeEditor

save project

parent 1eb7811a
Showing with 8 additions and 4 deletions
...@@ -2,7 +2,10 @@ import pygame ...@@ -2,7 +2,10 @@ import pygame
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
bg=pygame.image.load("bg.png")
sk=pygame.image.load("right.png")
ap=pygame.image.load("apple.png")
bd=pygame.image.load("body.png")
# 创建一个窗口 # 创建一个窗口
screen=pygame.display.set_mode((800,600)) screen=pygame.display.set_mode((800,600))
running = True running = True
...@@ -13,10 +16,10 @@ while running: ...@@ -13,10 +16,10 @@ while running:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == pygame.QUIT: if event.type == pygame.QUIT:
running = False running = False
bg=pygame.image.load("bg.png")
sk=pygame.image.load("right.png")
ap=pygame.image.load("apple.png")
screen.blit(bg,(0,0)) screen.blit(bg,(0,0))
screen.blit(sk,(240,180)) screen.blit(sk,(240,180))
screen.blit(bd,(210,180))
screen.blit(bd,(210,210))
screen.blit(ap,(540,420)) screen.blit(ap,(540,420))
pygame.display.update() 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