01_创建游戏现实窗口
import pygame
# pygame.display.set_mode(resolution=(0,0), flags=0, depth=0)初始化游戏显示窗口
# resolution指定屏幕的宽和高,默认创建的窗口大小和屏幕大小一致
# flags参数指定屏幕的附加选项,例如是否全屏等等,默认不需要传递
# depth 参数表示颜色的位数,默认自动匹配
# 必须用变量记录
# pygame.display.update()刷新屏幕内容显示
pygame.init()
screen=pygame.display.set_mode((480,700),0,0)
while True:
pass
pygame.quit()
01——描述大飞机
import pygame
#Rect是描述矩形区域的类
#Rect类只包含了一些数字计算,不用init()方法
#Rect类的size属性包含了宽度和高度
bigPlane_rect=pygame.Rect(100,500,120,125)
print("英雄的原点是%d %d"%(bigPlane_rect.x,bigPlane_rect.y))
print("英雄的尺寸是%d %d"%(bigPlane_rect.width,bigPlane_rect.height))
print("英雄的尺寸是%d %d"%bigPlane_rect.size)
02_实现图像绘制
import pygame
from pygame.locals import *
# 1.使用pygame.image.load()加载图像的数据
# 2.使用游戏屏幕对象,调用bl