Commit 6fd8f386 by BellCodeEditor

auto save

parent f3611b9b
Showing with 19 additions and 8 deletions
import pygame
from pygame import locals
import pygame #导入模块
from pygame import locals #导入事件模块
# 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口
ck=pygame.display.set_mode((600,600))
while True:
for i in pygame.event.get():
if i.type==locals.QUIT:
exit()
\ No newline at end of file
a1=pygame.image.load('apple.png') #苹果
a2=pygame.image.load('right.png') #头部
a3=pygame.image.load('body.png') #身体
a4=pygame.image.load('bg.png') #画布
ck=pygame.display.set_mode((600,600)) #创建窗口
while True: #无限循环(保存窗口)
for i in pygame.event.get(): #遍历
if i.type==locals.QUIT: #条件判断
exit() #条件符合结束程序
ck.blit(a4,(0,0)) #渲染素材
ck.blit(a1,(450,450))
ck.blit(a3,(210,120))
ck.blit(a3,(180,120))
ck.blit(a3,(180,90))
ck.blit(a2,(240,120))
pygame.display.update() #刷新窗口
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