Commit 2387afad by BellCodeEditor

save project

parent 2ae96912
Showing with 9 additions and 1 deletions
...@@ -3,13 +3,20 @@ from pygame import locals ...@@ -3,13 +3,20 @@ from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
snake=pygame.image.load("right.png")
body=pygame.image.load("body.png")
playground=pygame.image.load("bg.png")
# 创建一个窗口 # 创建一个窗口
a=pygame.display.set_mode((800,600)) a=pygame.display.set_mode((800,600))
pygame.image.load()
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
print(event) print(event)
if event.type == 12: if event.type == 12:
exit() exit()
a.blit(playground,(0,0))
a.blit(snake,(100,0))
a.blit(body,(0,0))
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