Commit 5a1ebb0d by BellCodeEditor

auto save

parent b26ef482
Showing with 11 additions and 2 deletions
...@@ -2,6 +2,15 @@ import pygame ...@@ -2,6 +2,15 @@ import pygame
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
beijing=pygame.image.load('bg.png') #导入图片,用变量来表示
# 创建一个窗口 # 创建一个窗口
?? screen = pygame.display.set_mode((660, 480))
\ No newline at end of file while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
screen.blit(beijing,(x,y))
#blit : 渲染图片的方法,括号里面:参数1代表图片对象,参数2代表位置(x,y)来表示
#screen :就是渲染图片要渲染在哪里,代表的是游戏窗口
\ 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