文章目录 [ 隐藏 ]
Python游戏开发
Date:2017 年 6 月 29 日
Pygame是一套用来写游戏的Python模块。它是基于SDL库的,它使你可以用Python语言创建完全界面化的游戏和多媒体程序。Pygame可以运行在几乎所有的平台和操作系统上。
Pygame是免费的,它是在LGPL许可证下发布的,你可以用它来创建免费软件、共享软件和商业游戏。
Pygame模块
在pygame中,有很多模块,每个模块对应着不同的功能,如果我们知道这些模块是做什么的,那么,对我们的游戏开发会起到关键性的作用。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
#pygame modules __author__ = {'name' : 'Hongten', 'mail' : 'hongtenzone@foxmail.com', 'blog' : 'http://www.cnblogs.com/hongten', 'QQ' : '648719819', 'Version' : '1.0'} __modules__ =''' pygame.cdrom 访问光驱 pygame.color 颜色 pygame.cursors 加载光标 pygame.display 访问显示设备 pygame.draw 绘制形状、线和点 pygame.event 管理事件 pygame.examples 不同的例子 pygame.font 使用字体 pygame.image 加载和存储图片 pygame.gfxdraw Anti-aliasing draw functions pygame.locals 常量 pygame.joystick 使用游戏手柄或者 类似的东西 pygame.key 读取键盘按键 pygame.mixer 声音 pygame.mouse 鼠标 pygame.movie 播放视频 pygame.music 播放音频 pygame.overlay 访问高级视频叠加 pygame 就是我们在学的这个东西了…… pygame.rect 管理矩形区域 pygame.scrap 本地剪贴板访问 pygame.sndarray 操作声音数据 pygame.sprite 操作移动图像 pygame.surface 管理图像和屏幕 pygame.surfarray 管理点阵图像数据 pygame.tests 测试例子 pygame.time 管理时间和帧信息 pygame.transform 缩放和移动图像 ''' print(__modules__) |