Python 和 PyGame 的一些示例
评论 15 条评论 38,267 人阅读
看到一个网页收集了很多使用Python和PyGame写游戏的示例,分享给大家。(注:我不知道用Python/PyGame写游戏其性能会怎么样,但是一些小游戏应该是没有问题的)
这个网页同时给了一本介绍Python和PyGame的电子书(PDF),下面的这些例子就是这本书的示例。所有的这些示例可以打包下载。
基础 Python 示例
- if_statement_examples.py – if 语句的一个简单示例
- for_loop_examples.py – for 语句的一个简单示例.
- while_loop_examples.py – while 语句的一个简单示例
Pygame 图形示例
Pygame 示例
游戏示例
创建一个安装包
搜索和排序示例
- example_sorted_names.txt – Sample file of names used in searching_example.py
- searching_example.py – Example linear and binary searches
- AliceInWonderLand.txt – Text of Alice In Wonderland. Source: Project Gutenberg
- AliceInWonderLand200.txt
- dictionary.txt
- sorting_examples.py – Example code for the insertion and selection sorts.
文件示例
high_score.py – Example that shows how to read and write a high score to the disk so that it persists between program runs.
其它信息
- Pygame Website – Pygame 主站
- Pygame Documentation – Pygame 文档
(全文完)
——————————
最后,不好意思很久没有更新酷壳,这段时间在国外出差,事多,5月31回国。大家见谅!
相关文章
Loading...



























