(最新版)基于Android的五子棋游戏设计与实现毕业设计

安徽大学

本科毕业论文(设计、创作)

题 目: 基于Android的五子棋游戏设计与实现

院(系): 计算机科学与技术学院 专业: 计算机科学与技术 入学时间: 2010 年 9 月 导师 : 邹海 职称学位: 副教授博士 导师所在单位: 安徽大学计算机科学与技术学院 完成时间: 2014 年 5 月

1

基于Android的五子棋游戏设计

摘 要

手机游戏被业内人士称为继短信之后的又一座“金矿”。 从2003年到2010年的市场销售额年均复合增长率为62.4%。可以看出,手机游戏将经历一个黄金发展时期。3G的普及、手机显示性能的提高、手机屏幕的扩大和较高的分辨率,解决了传统手机行业的很多弊端,手机休闲娱乐应用将成为PC休闲娱乐之后又一重要业务增长点。同时Android采用了键盘形式的按键,可以完成更复杂的操作。Android虽然基于Java,但是其虚拟机是基于寄存器的(这与普通的Java基于堆栈不同),速度得到很大的提升,这为Android平台上开发游戏提供了坚强的后盾。

本论文主要阐述以面向对象的程序开发语言eclipse为开发工具, 基于智能手机Android之上设计一个五子棋游戏。五子棋起源于中国古代的传统黑白棋种之一,它不仅能增强思维能力 提高智力,而且富含哲理,有助于修身养性。本系统是本系统中设定了人机对战和人人对战两种模式。人机对战实现的是一些简单的算法,人人对战只是进行了输赢方的判定。它与javame的五子棋设计有许多的不一样,Android本来就是全触摸的形式,而且操作非常简单。

关键词:五子棋;Android;人工智能

The Five in a Row Game Based on Android

Abstract

Mobile games since the industry was called after a text message \2010 annual sales surged 62.4 percent from compound rate for. Can see,mobile games will experience a golden period of development. 3G phone displays the popularization and performance improvement,the expansion of the phone's screen,and a ,solve the traditional mobile phone industry's many drawbacks, mobile entertainment applications will be after PC entertainment another important business growth. Meanwhile Android also USES a keyboard forms of buttons that can do more complex operation. Android though,but its based on a Java virtual machine (which is based on the register with the ordinary Java stack-based different),speed,it got a lot of ascension for the Android platform games provide a strong backing.

This paper mainly expounds the object-oriented program development in eclipse for language development tool, smartphone Android based on above design a five in a row game. Gobang originated in China ancient traditional black white kind, it not only can enhance one of thinking capacity, improve inligence and philosophy, -machine against and everyone against two patterns. The realization man-machine against some simple algorithm, everyone was against just win the judgement of the party. It many are dissimilar, Android is the entire touching form originally, moreover operates is simple.

Keywords:five-in-a-row;android;artificial inligence

目 录

1 引言???????????????????????????????????1 2 概述???????????????????????????????????2 2.1 背景??????????????????????????????????2 2.2 课题来源????????????????????????????????2 2.3 课题研究现状及应用前景?????????????????????????3 3 Android开发环境?????????????????????????????3 3.1 Android开发环境变量配置????????????????????????3 3.1.1 JDK的配置??????????????????????????????3 3.1.2 Android开发插件的安装????????????????????????4 3.1.3 AVD的创建??????????????????????????????5 4 游戏相关技术???????????????????????????????5 4.1 游戏布局????????????????????????????????5 4.1.1 画盘线????????????????????????????????5 4.1.2 双缓冲技术画棋子???????????????????????????6 4.1.3 在触摸处画棋子????????????????????????????7 4.1.4 newPoint方法将座标调整到对应的棋位上????????????????7 4.2 人人对战???????????????????????????????8 4.2.1 设置谁走的标记????????????????????????????8 4.2.2 在触摸处下棋子????????????????????????????9 4.2.3 判断轮到谁下棋子???????????????????????????9 4.2.4 玩家一下棋的方法???????????????????????????9 4.2.5 玩家二下棋的方法??????????????????????????10 4.2.6 实现判断输赢的方法?????????????????????????11 4.2.7 提示游戏结束????????????????????????????13 4.3 人机对战???????????????????????????????14

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4