嵌入式拼图游戏的设计与实现毕业论文 下载本文

兰州大学毕业论文设计

嵌入式拼图游戏

摘 要

拼图游戏是一种可变性很高且耐玩的游戏,在平时空闲的时候可以自己制定图片然后享受智力拼图,空闲之余不妨放松一下。拼图是一种大人与小孩都能玩的游戏,它可以开发智力且帮助大家提高动脑解决问题的能力。玩拼图还有助于手眼协调,玩家能训练和了解“部分”与“全部”的关系,可以知道许多的“部分”能拼凑出一个“全部”,以及一个“全部”是由许多“部分”所组成的。

本课题主要是在Linux环境下用嵌入式C语言及QT对一小型游戏进行开发。选择一个游戏的拼图图片,单击方框可使图片移动,从而能够拼出一幅完整的图片,这类游戏主要考察玩家的反应能力,在游戏之余提高观察和应变能力。

本游戏中通过分析C游戏的开发流程,对功能进行设计。该游戏主要实现了开始游戏,更改图片,游戏难度选择(9宫初级,16宫中级和25宫高级),战况成绩统计,成绩排名,背景音乐等功能。游戏界面美观,操作简单,功能齐全,是广大游戏爱好者都喜欢的一款游戏,具有一定的复杂性和可玩性。

关键词:拼图游戏;嵌入式;Linux;QT

i

兰州大学毕业论文设计

Embedded puzzle game

Abstract

Puzzle game is a kind of high variability and playable game, in the usual idle time can develop their own pictures and enjoy intellectual puzzles, more than the idle wish to relax. Jigsaw is an adults and children can play the game, it can develop intelligence and ability to help people improve their brains to solve problems. Puzzles also help hand-eye coordination, players can train and learn \well as an \

The main subject is embedded in the Linux environment using C language and QT for a small game development. Select a picture puzzle game, click the box to make the picture move, which can spell a complete picture, mainly on the type of game the players ability to respond to observe and improve the resilience of the remaining games.

By analyzing this game C game development process, functional design. The main achievement of the game to start the game, change the image, select game difficulty (9 Palace beginner, 16 intermediate and 25 Palace Palace senior), fighting performance statistics, standings, background music and other functions. Game beautiful interface, easy operation, complete functions, is the majority of gamers like a game, with a certain complexity and playability.

Key words: puzzle game;Embedded ; Linux;QT

ii

兰州大学毕业论文设计

目 录

摘 要 ................................................................................................................................................... i Abstract ................................................................................................................................................ ii 1 前言 ................................................................................................................................................ 1

1.1项目的目的与意义 ................................................................................................................ 1 1.2系统开发方法介绍 ................................................................................................................ 1 1.3本文结构 ................................................................................................................................ 3 2 项目开发语言及开发环境 ............................................................................................................ 4

2.1 C语言 .................................................................................................................................... 4

2.1.1设计特性 ..................................................................................................................... 4 2.1.2高效性 ......................................................................................................................... 4 2.1.3可移植性 ..................................................................................................................... 5 2.1.4强大的功能和灵活性 ................................................................................................. 5 2.1.5面向编程人员 ............................................................................................................. 5 2.1.6缺点 ............................................................................................................................. 5 2.2开发环境 ................................................................................................................................ 6 2.3 QT Creator ............................................................................................................................. 6 2.4 嵌入式开发 ........................................................................................................................... 6 3 可行性分析 .................................................................................................................................... 8

3.1可行性分析所采用的方法和步骤 ........................................................................................ 8 3.2可行性分析 ............................................................................................................................ 8 3.3稳定性 .................................................................................................................................... 9 4 总体设计 ...................................................................................................................................... 10

4.1功能需求 .............................................................................................................................. 10 4.2总体设计方案 ...................................................................................................................... 10 4.3系统流程设计 ...................................................................................................................... 11 4.4功能模块设计 ...................................................................................................................... 12 5 详细设计 ...................................................................................................................................... 15

5.1关键算法的设计与实现 ...................................................................................................... 15

5.1.1图片随机分割问题 ................................................................................................... 16 5.1.2判断图片是否可以交换 ........................................................................................... 21 5.1.3更改图片 ................................................................................................................... 22 5.2模块命名规则 ...................................................................................................................... 23 5.3 QSS文件 ............................................................................................................................. 26 5.4 用户界面快照设计概述 ..................................................................................................... 27 6 软件测试 ...................................................................................................................................... 29

6.1测试的目的及相关问题 ...................................................................................................... 29 6.2测试方法 .............................................................................................................................. 30 6.3部分测试用例 ...................................................................................................................... 32

6.3.1拼图测试 ................................................................................................................... 32 6.3.2游戏难度测试 ........................................................................................................... 32 6.3.3拼图游戏窗体外观测试 ........................................................................................... 33