Commit 919187c4 by BellCodeEditor

save project

parent 31e113b1
Showing with 8 additions and 0 deletions
...@@ -2,10 +2,17 @@ import pygame ...@@ -2,10 +2,17 @@ import pygame
from pygame import locals from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
breakground=pygame image.load('bg.png')
food=pygame image.load('apple.png')
right=pygame image.load('right.png')
# 创建一个窗口 # 创建一个窗口
screen=pygame.display.set_mode((800,600)) screen=pygame.display.set_mode((800,600))
pygame display.update
while True: while True:
for event in pygame.event get(): for event in pygame.event get():
if event.true==locals.QUIT if event.true==locals.QUIT
exit() exit()
screen.blit(breakground,(0,0))
screen.blit(food,(120,240))
screen.blit(right,(360,240))
\ 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