基于Qt的俄罗斯方块-开题报告

时间:2024.5.9

湖 南 工 学 院

本科毕业设计(论文)开题报告

(_2012_届)

基于Qt的俄罗斯方块开题报告

20xx年 3 月 1 日

基于Qt的俄罗斯方块开题报告

基于Qt的俄罗斯方块开题报告

基于Qt的俄罗斯方块开题报告

基于Qt的俄罗斯方块开题报告

基于Qt的俄罗斯方块开题报告

说明:开题报告作为毕业设计(论文)答辩委员会对学生答辩资格审查的依据材料之一,此报告应在导师指导下,由学生填写,将作为毕业设计(论文)成绩考查的重要依据,经导师审查后签署意见生效。


第二篇:基于JAVA的俄罗斯方块游戏开题报告和英文翻译


指导文件5:

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

毕 业 设 计(论文)开 题 报 告

计算机科学与信息工程 系(院)届

题 目(中文)基于JAVA的俄罗斯方块游戏(英文)Based on the Russian box JAVA games 课题类型 应用研究 课题来源 自 选 学生姓名 专业班级

指导教师 职 称

填写日期:年 月 日

1

2

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

3

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

4

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

5

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

6

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

7

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

8

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

说明:1、该表每生一份,系(院)妥善存档;

2、课题来源填:“自选”或“教师指定”或“其它”,课题类型填:“理论研究”或“应用研究”或“技术开发”或“实验设计”或“其它”。

附件:

9

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

毕业设计(论文)外文参考文献翻译

计算机科学与信息工程系(院)届

课题类型 应用研究 课题来源 自选 学生姓名 专业班级 班

指导教师 职 称

填写日期:年 月 日

目 录

10

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

题目:java编程方案分析

一 Java简介-----------------------------------------------------------12

二 Java语言-----------------------------------------------------------12

三 Java工具包介绍-----------------------------------------------------14

四 游戏的关键代码-----------------------------------------------------14

11

(本页及以下为文献翻译正文,外文文献可1-3篇,译文应大于5000汉字以上。每篇外文参考文献原文后排列其对应译文。正文编排页码,装订时连同其封面、目录一起装订。正文字体、字号自定。)

The java programming plan analyzes

一 Java synopsis

Java is Corporation the Java programming language which promoted in May, 1995 (hereafter refers to as the Java language) by Sun Microsystems and the Java platform always called.The HotJava browser realizes which with Java (supported Java applet) to demonstrate the Java charm: Cross platform, person or household who refuses to move and bargains for unreasonably high compensation when the land is requisitioned for a construction project Web, Internet computation. Henceforth, Java widely is accepted and impelled the Web rapid development, the commonly used browser supports Java applet now.On the other hand, the Java technology also unceasingly renews.

The Java platform by the Java virtual machine (Java Virtual Machine) and the Java application programming interface (Application Programming Interface, is called API) to constitute.The Java application programming interface was the Java application has provided an independence in the operating system standard connection, might divide into the major component and the expansion part. Installs a Java platform after the hardware 'OR' operation system platform, the Java application procedure may move.Now the Java platform already has inserted the nearly all operating system.Such Java procedure may only translate one time, may move in each kind of system.The Java application programming interface already developed from the 1.1x version to

1.2 edition.At present the commonly used Java platform based on Java1.4, the recent edition is Java1.6. Java divides into three system JavaSE, JavaEE, JavaME.

二 Java language

The Java language is a support network computation object-oriented programming language.The Java language has absorbed the Smalltalk language and the C language merit, and increased other characteristics, like support concurrent programming, network correspondence, and multimedia data management and so on.The principal characteristic is as follows:

1st, the Java language is simple.The Java language grammar and the C language and the

C language are very close, make the majority programmers to be very easy to study and to use Java.On the other hand, Java has discarded C Very little uses, very difficultly to understand, the misleading these characteristics, like instruction character heavy load, multi-inheritances, automatic compulsion type transformation. The Java language does not use the indicator specially, and has provided the automatic waste material collection, causes the programmer not to need to worry for the memory management.

2nd, the Java language is one object-oriented.The Java language provides kind of, primitive and so on connection and inheritance, for simplicity, only supports class the between list inheritance, but between the support connection multi-inheritances, and support class and between the connection realization mechanism (key words are implements).Java language comprehensive support dynamic binding, but C Language only to empty function use dynamic binding. In brief, the Java language is a pure object-oriented programming language.

3rd, the Java language is distributional.The Java language supports the Internet application the development, has a network application programming interface in the basic Java application programming interface (java.net), it provided has used in the network application programming a kind of storehouse, including URL, URLConnection, Socket, ServerSocket and so on. 12

Java RMI (long-distance method activates) the mechanism also is develops the distributional application the important method.

4th, the Java language is vigorous and healthy.The Java strong type machine-made, the exception handling, the waste material automatic collection and so on is the Java procedure toughness important guarantee.To indicator discarding is the Java unwise choice.The Java security check mechanism causes Java to have the toughness.

5th, the Java language is safe.Java is usually used in the network environment, for this, Java provided a safety mechanism to guard against the malicious code the attack. Many security features has which besides the Java language, Java to has a safe guard mechanism through the network downloading kind (kind of ClassLoader), like the assignment different name space guards against the substitution locally of the same name kind of, the syllabified code inspection, and provides the safety control mechanism (kind of SecurityManager) to let Java apply the establishment security sentry.

6th, the Java language is the architecture neutrality.The Java procedure (suffix is the java document) is translated in the Java platform for the architecture neutrality byte code form (suffix is the class document), then may in realize in this Java platform any system to move.This way suits in isomerism network environment and the software distribution.

7th, the Java language is may transplant.This kind of probability originates from the architecture neutrality, moreover, Java strictly has also stipulated each master data type length.Java system itself also has the very strong probability, the Java compiler is realizes with Java, the Java movement environment is realizes with ANSI C.

8th, the Java language is the explanation.As mentioned above, the Java procedure is translated in the Java platform for the byte code form, then may in realize in this Java platform any system to move.When movement, Java in the platform Java interpreter carries on the explanation execution to these bytes codes, the kind which in the implementation needs is written down in the joint stage in the movement environment.

9th, Java is a high performance.Compares with these explanation high-level script language, Java indeed is a high performance.In fact, the Java running rate more and more approaches along with the JIT(Just-In-Time) compiler technology development in C.

10th, the Java language is a multithreading.In the Java language, the thread is one kind of special object, it must or its sub-(grandson) the kind founds by the Thread kind. Usually has two methods to found the thread: First, the operational construction was the Thread(Runnable) structure realizes one the Runnable connection object packing to become a thread, its two, derived the subclass from the Thread kind and rewrites the run method, uses the object which this subclass founded is the thread. It is noteworthy that the Thread kind has already realized the Runnable connection, therefore, any thread had its run method, but in the run method has contained the code which the thread had to move.The thread activity controls by group of methods. The Java language supports many threads at the same time execution, and provides between multi-thread the synchronized mechanism (key words is synchronized).

11th, the Java language is dynamic.One of Java language design goals is adapts in the dynamic change environment.The Java procedure needs the kind can dynamic write down the movement environment, also may write down the kind through the network which needs.This is also advantageous to the software promotion.Moreover, in the Java kind has a movement time expression, can carry on the movement time the type inspection.

The Java language fine characteristic causes Java to apply has the incomparable toughness and the reliability, this also reduced the application system maintenance cost.Java API which 13

inlays to the object technology comprehensive support and in the Java platform can reduce the application system the development time and reduces the cost.The Java translation one time, everywhere may move the characteristic enables it to be able to provide a everywhere available open structure and transmits the information between the multi-platforms the low cost way.

In the Java technology, is worth paying attention also has JavaBeans, it is an open standard module architecture, it is independent in the platform, but uses the Java language.JavaBean is one satisfies JavaBeans the standard the Java kind, usually has defined a real world thing or the concept.

A JavaBean main characteristic including attribute, method and event. Usually has defined a real world thing or the concept.A JavaBean main characteristic including attribute, method and event.Usually, supports the JavaBeans standard in one the development environment (for example Sun Java Studio and IBM VisualAge for Java), may visible operate JavaBean, also may use JavaBean which the JavaBean structure new goods come into the market. The JavaBean superiority also lies in the probability which Java brings.Now, EJB (Enterprise JavaBeans) expands the JavaBean concept to the Java service end module architecture, this model support multi-layer distributional object application.

三 Java tool bags introduced that:

1. AWT: It is Abstract Window ToolKit (abstract window tool bag) the abbreviation, this tool bag provided a set to carry on the interactive connection with the local graphical interface.In the AWT graph function and the operating system provide between the graph function has 11 corresponding relations, we are called it peers. In other words, when we use AWT comes the component graphical user interface time, we in fact are the graph storehouse which provides in the use operating system.Because the different operating system graph storehouse provides the function is dissimilar, has the function in a platform in other platform then possibly does not exist. In order to realize a " translation which the Java language declared, everywhere moves the " concept, AWT can not but realize its platform independency through the sacrifice function, in other words, AWT provides the graph function is graph function occurring together which each kind of general operating system provides.Because AWT is the dependence local method realizes its function, we usually control AWT to be called heavyweight control.

2. Swing: It is a set of new graphical interface system which constructs in the AWT foundation, it has provided all functions which AWT can provide, and has carried on the large scale expansion with the pure Java code to the AWT function.For example said was not all operating system all provides has controlled a support to the shape of tree, Swing uses the basic mapping method which in AWT provided to control to the shape of tree to carry on the simulation. Swing 100Because has not used the local method in Swing to realize the graph function, we usually control Swing to be called the lightweight to control.

四 game essential codes:

1. first is the block type, the distortion.

class ErsBlock extends Thread {

/**

* A block occupies the number of lines is 4 lines

*/

public final static int BOXES_ROWS = 4;

/**

* A block occupies the enumeration is 4 rows

*/

14

public final static int BOXES_COLS = 4;

/**

* Lets the promotion change smooth factor, avoids the final several level of between speed phase difference near time

*/

public final static int LEVEL_FLATNESS_GENE = 3;

/**

* Between the close two levels, a block each whereabouts line of time difference is how many (millisecond)

*/

public final static int BETWEEN_LEVELS_DEGRESS_TIME = 50;

/**

* The block style number is 7

*/

private final static int BLOCK_KIND_NUMBER = 7;

/**

* Each style block reverse condition type is 4

*/

private final static int BLOCK_STATUS_NUMBER = 4;

/**

* Corresponds separately to 7 kind of model 28 conditions

*/

public final static int[][] STYLES = {// altogether 28 conditions

{0x0f00, 0x4444, 0x0f00, 0x4444}, // sliver of four condition

{0x04e0, 0x0464, 0x00e4, 0x04c4}, // 'T'xing four conditions

{0x4620, 0x6c00, 0x4620, 0x6c00}, // counter-' Z'xing four conditions

{0x2640, 0xc600, 0x2640, 0xc600}, // 'Z'xing four conditions

{0x6220, 0x1700, 0x2230, 0x0740}, // '7 ' four conditions

{0x6440, 0x0e20, 0x44c0, 0x8e00}, // counter-' 7 ' four conditions

{0x0660, 0x0660, 0x0660, 0x0660}, // block four conditions

};

private GameCanvas canvas;

private ErsBox[][] boxes = new ErsBox[BOXES_ROWS][BOXES_COLS];

private int style, y, x, level;

private boolean pausing = false, moving = true;

2. another is disappears a line of judgment and the score change。

* A turn game process, has realized the Runnable connection

* A turn game is a big circulation, in this circulation, each 100 milliseconds, * In inspection game current block whether already, if does not have,

* Continues to wait for.If, looked has the entire stuff line,

* If has deletes it, and adds the minute for the player, simultaneously is stochastic produces one

* The new current block, lets its automatic whereabouts.

15

* When produces a block newly, first inspects a line which the canvas most goes against whether already

* Has been occupied, if is, might judge Game Over.

*/

private class Game implements Runnable {

public void run() {

int col = (int) (Math.random() * (canvas.getCols() - 3)), style = ErsBlock.STYLES[(int) (Math.random() * 7)][(int) (Math.random() *

4)];

while (playing) {

if (block != null) { // When first circulation, block is spatial }

checkFullLine(); // inspects whether has entire stuff line of

if (isGameOver()) { // inspects plays whether should finish

miPlay.setEnabled(true);

miPause.setEnabled(true); miResume.setEnabled(false); ctrlPanel.setPlayButtonEnable(true); ctrlPanel.setPauseButtonLabel(true);

reportGameOver();

if (block.isAlive()) { } try { Thread.currentThread().sleep(100); } catch (InterruptedException ie) { } continue; ie.printStackTrace(); return; 16

}

block = new ErsBlock(style, -1, col, getLevel(), canvas);

block.start();

col = (int) (Math.random() * (canvas.getCols() - 3));

style = ErsBlock.STYLES[(int) (Math.random() * 7)][(int) (Math.random() * 4)];

ctrlPanel.setTipStyle(style);

} }

/**

* Inspects in the canvas whether has the entire stuff line, if has deletes it */

public void checkFullLine() {

for (int i = 0; i < canvas.getRows(); i++) {

int row = -1;

boolean fullLineColorBox = true;

for (int j = 0; j < canvas.getCols(); j++) {

if (!canvas.getBox(i, j).isColorBox()) {

fullLineColorBox = false;

break;

}

}

if (fullLineColorBox) {

row = i--;

canvas.removeLine(row);

}

}

}

/**

* The basis most went against the line whether is occupied, the judgment plays whether already finished.

* @return boolean, the true- game had ended, the false- game had not finished */

private boolean isGameOver() {

for (int i = 0; i < canvas.getCols(); i++) {

ErsBox box = canvas.getBox(0, i);

if (box.isColorBox()) return true;

}

return false;

}

17

译文: }

java编程方案分析

一 Java简介

Java是由Sun Microsystems公司于19xx年5月推出的Java程序设计语言(以下简称Java语言)和Java平台的总称。用Java实现的HotJava浏览器(支持Java applet)显示了Java的魅力:跨平台、动感的Web、Internet计算。从此,Java被广泛接受并推动了Web的迅速发展,常用的浏览器现在均支持Java applet。另一方面,Java技术也不断更新。

Java平台由Java虚拟机(Java Virtual Machine)和Java 应用编程接口(Application Programming Interface、简称API)构成。Java 应用编程接口为Java应用提供了一个独立于操作系统的标准接口,可分为基本部分和扩展部分。在硬件或操作系统平台上安装一个Java平台之后,Java应用程序就可运行。现在Java平台已经嵌入了几乎所有的操作系统。这样Java程序可以只编译一次,就可以在各种系统中运行。Java应用编程接口已经从1.1x版发展到1.2版。目前常用的Java平台基于Java1.4,最近版本为Java1.6。

Java分为三个体系JavaSE,JavaEE,JavaME。

二 Java语言

Java语言是一个支持网络计算的面向对象程序设计语言。Java语言吸收了Smalltalk语言和C++语言的优点,并增加了其它特性,如支持并发程序设计、网络通信、和多媒体数据控制等。主要特性如下:

1、Java语言是简单的。Java语言的语法与C语言和C++语言很接近,使得大多数程序员很容易学习和使用Java。另一方面,Java丢弃了C++ 中很少使用的、很难理解的、令人迷惑的那些特性,如操作符重载、多继承、自动的强制类型转换。特别地,Java语言不使用指针,并提供了自动的废料收集,使得程序员不必为内存管理而担忧。

2、Java语言是一个面向对象的。Java语言提供类、接口和继承等原语,为了简单起见,只支持类之间的单继承,但支持接口之间的多继承,并支持类与接口之间的实现机制(关键字为implements)。Java语言全面支持动态绑定,而C++ 语言只对虚函数使用动态绑定。总之,Java语言是一个纯的面向对象程序设计语言。

3、Java语言是分布式的。Java语言支持Internet应用的开发,在基本的Java应用编程接口中有一个网络应用编程接口(java.net),它提供了用于网络应用编程的类库,包括URL、URLConnection、Socket、 ServerSocket等。Java的RMI(远程方法激活)机制也是开发分布式应用的重要手段。

4、Java语言是健壮的。Java的强类型机制、异常处理、废料的自动收集等是Java程序健壮性的重要保证。对指针的丢弃是Java的明智选择。Java的安全检查机制使得Java更具健壮性。

5、Java语言是安全的。Java通常被用在网络环境中,为此,Java提供了一个安全机制以防恶意代码的攻击。除了Java语言具有的许多安全特性以外,Java对通过网络下载的类具有一个安全防范机制(类ClassLoader),如分配不同的名字空间以防替代本地的同名类、字节代码检查,并提供安全管理机制(类SecurityManager)让Java应用设置安全哨兵。

18

6、Java语言是体系结构中立的。Java程序(后缀为java的文件)在Java平台上被编译为体系结构中立的字节码格式(后缀为class的文件), 然后可以在实现这个Java平台的任何系统中运行。这种途径适合于异构的网络环境和软件的分发。

7、Java语言是可移植的。这种可移植性来源于体系结构中立性,另外,Java还严格规定了各个基本数据类型的长度。Java系统本身也具有很强的可移植性,Java编译器是用Java实现的,Java的运行环境是用ANSI C实现的。

8、Java语言是解释型的。如前所述,Java程序在Java平台上被编译为字节码格式, 然后可以在实现这个Java平台的任何系统中运行。在运行时,Java平台中的Java解释器对这些字节码进行解释执行,执行过程中需要的类在联接阶段被载入到运行环境中。

9、Java是高性能的。与那些解释型的高级脚本语言相比,Java的确是高性能的。事实上,Java的运行速度随着JIT(Just-In-Time)编译器技术的发展越来越接近于C++。

10、Java语言是多线程的。在Java语言中,线程是一种特殊的对象,它必须由Thread类或其子(孙)类来创建。通常有两种方法来创建线程:其一,使用型构为Thread(Runnable) 的构造子将一个实现了Runnable接口的对象包装成一个线程,其二,从Thread类派生出子类并重写run方法,使用该子类创建的对象即为线程。值得注意的是Thread类已经实现了Runnable接口,因此,任何一个线程均有它的run方法,而run方法中包含了线程所要运行的代码。线程的活动由一组方法来控制。 Java语言支持多个线程的同时执行,并提供多线程之间的同步机制(关键字为synchronized)。

11、Java语言是动态的。Java语言的设计目标之一是适应于动态变化的环境。Java程序需要的类能动态地被载入到运行环境,也可以通过网络来载入所需要的类。这也有利于软件的升级。另外,Java中的类有一个运行时刻的表示,能进行运行时刻的类型检查。

Java语言的优良特性使得Java应用具有无比的健壮性和可靠性,这也减少了应用系统的维护费用。Java对对象技术的全面支持和Java平台内嵌的API能缩短应用系统的开发时间并降低成本。Java的编译一次,到处可运行的特性使得它能够提供一个随处可用的开放结构和在多平台之间传递信息的低成本方式。

在Java技术中,值得关注的还有JavaBeans,它是一个开放的标准的组件体系结构,它独立于平台,但使用Java语言。一个JavaBean是一个满足JavaBeans规范的Java类,通常定义了一个现实世界的事物或概念。一个JavaBean的主要特征包括属性、方法和事件。通常,在一个支持JavaBeans规范的开发环境(如Sun Java Studio 和IBM VisualAge for Java)中,可以可视地操作JavaBean,也可以使用JavaBean构造出新的JavaBean。JavaBean的优势还在于Java带来的可移植性。现在,EJB (Enterprise JavaBeans) 将JavaBean概念扩展到Java服务端组件体系结构,这个模型支持多层的分布式对象应用。

三 Java工具包介绍:

1. AWT:它是Abstract Window ToolKit (抽象窗口工具包)的缩写,这个工具包提供了一套与本地图形界面进行交互的接口。AWT 中的图形函数与操作系统所提供的图形函数之间有着一一对应的关系,我们把它称为peers。 也就是说,当我们利用 AWT 来构件图形用户界面的时候,我们实际上是在利用操作系统所提供的图形库。由于不同操作系统的图形库所提供的功能是不一样的,在一个平台上存在的功能在另外一个平台上则可能不存在。为了实现Java语言所宣称的"一次编译,到处运行"的概念,AWT 不得不通过牺牲功能来实现其平台无关性,也就是说,AWT 所提供的图形功能是各种通用型操作系统所提供的图形功能的交集。由于AWT 是依靠本地方法来实现其功能的,我们通常把AWT控件称为重量级控件。

2. Swing:它是在AWT的基础上构建的一套新的图形界面系统,它提供了AWT 所能够提供的所有功能,并且用纯粹的Java代码对AWT 的功能进行了大幅度的扩充。例如说并不是所有的操作系统都提供了对树形控件的支持, Swing 利用了AWT 中所提供的基本作图方法对树形控件进行模拟。由于 Swing 控件是用100%的Java代码来实现的,因此在一个平台上设计的树形控件可以在其他平台上使用。由于在Swing 中没有使用本地方法来实现图形功能,我们通常把Swing控件称为轻量级控件。

四 游戏的关键代码:

1.首先是块的种类,变形

19

class ErsBlock extends Thread {

/** * 一个块占的行数是4行 */ public final static int BOXES_ROWS = 4; /** * 一个块占的列数是4列 */ public final static int BOXES_COLS = 4; /** * 让升级变化平滑的因子,避免最后几级之间的速度相差近一倍 */ public final static int LEVEL_FLATNESS_GENE = 3; /** * 相近的两级之间,块每下落一行的时间差别为多少(毫秒) */ public final static int BETWEEN_LEVELS_DEGRESS_TIME = 50; /** * 方块的样式数目为7 */ private final static int BLOCK_KIND_NUMBER = 7; /** * 每一个样式的方块的反转状态种类为4 */ private final static int BLOCK_STATUS_NUMBER = 4; /** 20

* 分别对应对7种模型的28种状态 */ public final static int[][] STYLES = {// 共28种状态 };

private GameCanvas canvas; {0x0f00, 0x4444, 0x0f00, 0x4444}, // 长条型的四种状态 {0x04e0, 0x0464, 0x00e4, 0x04c4}, // 'T'型的四种状态 {0x4620, 0x6c00, 0x4620, 0x6c00}, // 反'Z'型的四种状态 {0x2640, 0xc600, 0x2640, 0xc600}, // 'Z'型的四种状态 {0x6220, 0x1700, 0x2230, 0x0740}, // '7'型的四种状态 {0x6440, 0x0e20, 0x44c0, 0x8e00}, // 反'7'型的四种状态 {0x0660, 0x0660, 0x0660, 0x0660}, // 方块的四种状态

private ErsBox[][] boxes = new ErsBox[BOXES_ROWS][BOXES_COLS]; private int style, y, x, level; private boolean pausing = false, moving = true;

2.再一个就是消行的判断和分数的变化

* 一轮游戏过程,实现了Runnable接口

* 一轮游戏是一个大循环,在这个循环中,每隔100毫秒, * 检查游戏中的当前块是否已经到底了,如果没有, * 就继续等待。如果到底了,就看有没有全填满的行, * 如果有就删除它,并为游戏者加分,同时随机产生一个 * 新的当前块,让它自动下落。 * 当新产生一个块时,先检查画布最顶上的一行是否已经 * 被占了,如果是,可以判断Game Over了。 */ private class Game implements Runnable { 21

public void run() {

int col = (int) (Math.random() * (canvas.getCols() - 3)), style = ErsBlock.STYLES[(int) (Math.random() * 7)][(int) (Math.random() *

4)];

while (playing) {

if (block != null) { //第一次循环时,block为空 }

checkFullLine(); //检查是否有全填满的行

if (isGameOver()) { //检查游戏是否应该结束了

miPlay.setEnabled(true); miPause.setEnabled(true); miResume.setEnabled(false); ctrlPanel.setPlayButtonEnable(true); ctrlPanel.setPauseButtonLabel(true);

reportGameOver();

}

block = new ErsBlock(style, -1, col, getLevel(), canvas);

if (block.isAlive()) { } try { Thread.currentThread().sleep(100); } catch (InterruptedException ie) { } continue; ie.printStackTrace(); return; block.start(); 22

col = (int) (Math.random() * (canvas.getCols() - 3));

style = ErsBlock.STYLES[(int) (Math.random() * 7)][(int) (Math.random() * 4)];

ctrlPanel.setTipStyle(style);

} }

/**

* 检查画布中是否有全填满的行,如果有就删除之

*/

public void checkFullLine() {

for (int i = 0; i < canvas.getRows(); i++) {

int row = -1;

boolean fullLineColorBox = true;

for (int j = 0; j < canvas.getCols(); j++) {

if (!canvas.getBox(i, j).isColorBox()) {

fullLineColorBox = false;

break;

}

}

if (fullLineColorBox) {

row = i--;

canvas.removeLine(row);

}

}

}

/**

* 根据最顶行是否被占,判断游戏是否已经结束了。

* @return boolean, true-游戏结束了,false-游戏未结束

*/

private boolean isGameOver() {

for (int i = 0; i < canvas.getCols(); i++) {

ErsBox box = canvas.getBox(0, i);

if (box.isColorBox()) return true;

}

return false;

}

}

23

更多相关推荐:
俄罗斯方块游戏开题报告

届毕业设计开题报告题目基于C的网上汽车租赁管理系统的设计与实验专业姓名班级09通信Y1指导教师查志琴起止日期20xx120xx620xx年01月01日师的指导下由学生填写经导师签署意见及系部审核后生效

俄罗斯方块开题报告

蚌埠学院本科毕业设计论文开题报告计算机科学与技术系20xx届10级计算机科学与技术1班注开题报告由学生在毕业设计论文工作前期内完成外语专业的开题报告必须用相应的语种写作开题报告须经指导教师审阅并签字后才能生效本...

俄罗斯方块游戏开题报告

炎黄职业技术学院信息工程系毕业设计论文开题报告书

俄罗斯方块开题报告

毕业论文设计选题报告

基于Java的俄罗斯方块游戏的设计与开发-开题报告

本科生毕业设计论文开题报告题目基于Java的俄罗斯方块游戏的设计与开发姓名年级专业网络工程指导教师姓名学科枣庄学院信息科学与工程学院制20xx年11月说明一开题报告前的准备毕业设计论文题目确定后学生应尽快征求导...

开题报告 基于Java的俄罗斯方块游戏系统的设计与实现

贵阳学院毕业论文设计开题报告表

网络俄罗斯方块毕业设计论文开题报告

开题报告一选题的背景随着计算机技术的飞速发展计算机硬件和软件成本的逐渐降低使得人手一台计算机的梦想成为可能特别是近几年计算机的普及速度达到了空前的高度计算机在我国普及的速度更是举世瞩目的这一点可以从我国互联网用...

基于JAVA的俄罗斯方块游戏开题报告和英文翻译

指导文件5毕业设计论文开题报告计算机科学与信息工程系院届题目中文基于JAVA的俄罗斯方块游戏英文BasedontheRussianboxJAVAgames课题类型应用研究课题来源自选学生姓名专业班级指导教师职称...

C语言编写俄罗斯方块实验报告

学院数计学院班级学号姓名1摘要关键字目录第一部分设计总概摘要一设计目的二设计要求三设计内容四系统分析与设计第二部分数据结构设计第三部分功能实现与程序调试第四部分完成设计一实习日记二实习总结三教师评语四程序使用说...

游戏设计俄罗斯方块实验报告

江苏省惠山中等专业学校实验报告课程名称C程序设计实验名称游戏设计俄罗斯方块班级G1241姓名鲍顺亮日期指导教师卫洛斌成绩

俄罗斯方块设计报告书

海南师范大学软件设计模式课程报告20xx20xx年度第一学期课程名称题目院系信息科学技术学院班级任课教师成员1成绩评定分数一任务分配二指导教师评语2目录目录3摘要4一绪论511俄罗斯方块游戏简介512俄罗斯方块...

俄罗斯方块实验报告

程序设计实践报告20xx20xx学年第2学期题目专学生姓班级学指导教指导单日俄罗斯方块游戏设计业名号师位软件工程系期20xx0327俄罗斯方块游戏设计一课题内容和要求本程序的主要任务就是编写简单的俄罗斯方块游戏...

俄罗斯方块开题报告(11篇)