Commit f6af1b13 by BellCodeEditor

save project

parent ced025d2
Showing with 7 additions and 1 deletions
import pygame import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
from pygame import locals background = pygame.image.load('bg.png')
x = 800 x = 800
y = 600 y = 600
# 创建一个窗口 # 创建一个窗口
...@@ -15,3 +18,5 @@ while True: ...@@ -15,3 +18,5 @@ while True:
y -= 20 y -= 20
screen = pygame.display.set_mode((x,y)) screen = pygame.display.set_mode((x,y))
screen = pygame.display.set_mode((x,y)) screen = pygame.display.set_mode((x,y))
screen.blit(background,(10,10))
screen.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