摘要
Pygame 是一组用来开发游戏软件的 Python 程序模块,此项目就是导入Pygame模块来设计开发简单拼图游戏,引入Random模块,随机打乱拼图次数、拼图块坐标、拼图图片,将图像分为m×n个矩形块,并将图像右下角的矩形块替换为空白块后,将这些矩形块随机摆放成原图像的形状。游戏目标为通过移动非空白块将随机摆放获得的图像恢复成原图像的模样,且规定移动操作仅存在于非空白块移动到空白块。
关键字:Pygame、Python、Random
Abstract
Pygame is a set of Python programs to develop game software module, this project is to import Pygame module to design a simple puzzle game, the introduction of the Random module, Random disturb jigsaw puzzle, jigsaw puzzle piece of coordinates, image, the image is divided into m * n rectangle block, and replaced with blank blocks of the image at the bottom right corner rectangle, the rectangle block randomized into the shape of the original image.The goal of the game is to restore the image obtained by randomly placing the non-blank block to the original image by moving the non-blank block, and the movement operation only exists when the non-blank block is moved to the blank block.
Keywords: Pygame, Python, Random
第1章 引言
1.1 课题背景
拼图游戏是家喻户晓的益智类小游戏,不管是哪个年龄段都有它的爱好者,随着社会的发展,生活节奏越来越快,人们的压力也越来越大,通过玩休闲益智类游戏解压,成为忙碌的都市人们的不二选择。拼图游戏就是其中很有代表性的一种,它可以使人在休闲娱乐的同时锻炼记忆力、观察力。
1.2 目的和意义
选择这个拼图游戏作为课题,一方面是想学习和掌握Pygame的课外知识,另一方面可增加学习的趣味性和培养对此课程的兴趣。相对国外对Pygame研究的热火朝天,国内则显得比较冷淡,甚至商场上都没有一本完整地介绍Pygame框架的指导书,希望通过这次的游戏设计,使得更多人投入研究Pygame框架中。
1.3 国内外的发展现状
96,97年的国产游戏产品是单机版的游戏,在当时的市场上虽然品质和档次不如外来产品,但也占有一定的市场,例如《仙剑奇侠传》、《三国志》等系列带有鲜明中国特色与气息的游戏在市场上掀起了一波高潮。1998年联众与中国游戏中心等老牌的游戏平台的推出标志着电脑游戏在中国的开荒与生根。但是到了199