Commit 9e4b7c25 by BellCodeEditor

save project

parent ef131685
Showing with 11 additions and 0 deletions
...@@ -3,6 +3,11 @@ from pygame import locals ...@@ -3,6 +3,11 @@ from pygame import locals
from random import randint from random import randint
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
t = pygame.image.load("bg.png")
h = pygame.image.load("body.png")
f = pygame.image.load("up.png")
g = pygame.image.load("apple.png")
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((600,800)) screen = pygame.display.set_mode((600,800))
...@@ -12,5 +17,10 @@ while True: ...@@ -12,5 +17,10 @@ while True:
print(event) print(event)
if event.type==locals.QUIT: if event.type==locals.QUIT:
exit() exit()
screen.blit(t,(0,0))
screen.blit(h,(180,120))
screen.blit(f,(180,90))
screen.blit(g,(120,60))
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