资源简介
这是一个功能相对全的JAVA版3D俄罗斯方块,Java课程设计设计,俄罗斯方块小游戏,游戏中方块可左、右移动,旋转,加速。
代码片段和文件信息
package org.teacake.monolith.apk;
public class Block
{
public static final int BLOCKTYPE_STICK=0;
public static final int BLOCKTYPE_SQUARE=1;
public static final int BLOCKTYPE_LETTERT=2;
public static final int BLOCKTYPE_LETTERS=3;
public static final int BLOCKTYPE_NUMBER2=4;
public static final int BLOCKTYPE_GAMMA=5;
public static final int BLOCKTYPE_GAMMAINV=6;
public Block()
{
this.subblocks = new SubBlock[4];
this.subblocks[0] =new SubBlock();
this.subblocks[1] =new SubBlock();
this.subblocks[2] =new SubBlock();
this.subblocks[3] =new SubBlock();
this.xPos = 3;
this.yPos = 0;
int blocktype = randomgen.nextInt(7);
if(enableMonolithBlocks)
{
if(randomgen.nextInt(20)==10)
{
this.isMonolithBlock = true;
}
else
{
this.isMonolithBlock = false;
}
}
else
{
this.isMonolithBlock = false;
}
this.orientation = 0;
switch(blocktype)
{
case 0:
this.blocktype = BLOCKTYPE_STICK;
this.color = 0;
break;
case 1:
this.blocktype = BLOCKTYPE_SQUARE;
this.color = 1;
break;
case 2:
this.blocktype = BLOCKTYPE_LETTERT;
this.color = 2;
break;
case 3:
this.blocktype = BLOCKTYPE_LETTERS;
this.color = 3;
break;
case 4:
this.blocktype = BLOCKTYPE_NUMBER2;
this.color = 4;
break;
case 5:
this.blocktype = BLOCKTYPE_GAMMA;
this.color = 5;
break;
case 6:
this.blocktype = BLOCKTYPE_GAMMAINV;
this.color = 6;
break;
}
if(this.isMonolithBlock)
{
this.color = 7;
}
this.recalcBlockOrientation();
}
public Block(int theTypeint xPos int yPos)
{
this.subblocks = new SubBlock[4];
this.subblocks[0] =new SubBlock();
this.subblocks[1] =new SubBlock();
this.subblocks[2] =new SubBlock();
this.subblocks[3] =new SubBlock();
this.blocktype= theType;
this.orientation= 0;
switch(this.blocktype)
{
case BLOCKTYPE_STICK:
this.color=0;
break;
case BLOCKTYPE_SQUARE:
this.color = 1;
break;
case BLOCKTYPE_LETTERT:
this.color = 2;
break;
case BLOCKTYPE_LETTERS:
this.color = 3;
break;
case BLOCKTYPE_NUMBER2:
this.color = 4;
break;
case BLOCKTYPE_GAMMA:
this.color = 5;
break;
case BLOCKTYPE_GAMMAINV:
this.color = 6;
break;
}
if(this.isMonolithBlock)
{
this.color = 7;
}
this.recalcBlockOrientation();
}
public void rotateClockwise()
{
if (orientation <3)
{
orientation++;
}
else
{
this.orientation = 0;
}
recalcBlockOrientation();
}
public void rotateCounterClockwise()
{
if (orientation >0)
{
orientation--;
}
else
{
orientation = 3;
}
recalcBlockOrientation();
}
public void recalcBlockOrientation()
{
switch(this.blocktype)
{
case BLOCKTYPE_STICK:
if (this.orientation==0 || this.orientation=
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-09-07 17:32 monolithandroid-read-only\
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\
文件 3 2013-09-07 17:32 monolithandroid-read-only\.svn\entries
文件 3 2013-09-07 17:32 monolithandroid-read-only\.svn\format
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\00\
文件 4833 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\00\007614030f84f7491f68a8e669b96626cbbddfd8.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\02\
文件 1734 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\02\020406be38cdacdd260106f7ce425bc941a20f9e.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\07\
文件 2033 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\07\077c536a619ded4461d3673658b73e553f72e52b.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\0b\
文件 9369 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\0b\0b4429017abfb627039c4b90dcbb9282ef243b2b.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\0c\
文件 3173 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\0c\0c166c6ab012bdb11ac0bb05dea0d135e8cd3e67.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\0e\
文件 715 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\0e\0ecf8f31a1a8c4092cd3621546123e5d8b61f36b.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\13\
文件 1955 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\13\13511729525aa9f8a4633d2054c9e574cc113d30.svn-ba
文件 1977 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\13\13e289716b8a23f0a12c7c6296a866e648da0e64.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\1c\
文件 1435 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\1c\1ca4b5e5bb9de1a49b9f8751d233e8a8400552c2.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\21\
文件 3302 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\21\215e2a85a95912d284f53bb22789c1c104d6f033.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\22\
文件 1683 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\22\224d50adbc36e08fbb0cbd5f5fe4269d88c555a1.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\28\
文件 15047 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\28\28eb52587c08d36922a085180024cfd84c1851ba.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\2a\
文件 1093 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\2a\2a7ea625a6f593c7db0a730acff0097fc6c73423.svn-ba
目录 0 2013-09-07 17:32 monolithandroid-read-only\.svn\pristine\2b\
............此处省略207个文件信息
- 上一篇:天津理工操作系统实验三java带界面
- 下一篇:Java实现朴素贝叶斯分类器
相关资源
- mysql数据处理,java用户登录处理
- 法律咨询信息系统(java+jsp+sqlserver)
- Java快速开发平台源码(renren-fast)
- 锐聘学院QST青软JavaWeb十二个打包
- 3.3.6微信支付JAVA版demo
- javaweb网上购物系统源码(附数据库脚
- javaweb校园宿舍系统(附数据库脚本)
- JavaWeb书城项目(附数据库脚本)
- 基于JAVA_JSP电子书系统(源码+数据库
- Java网络编程知识点总结.xmind
- 一站式Java网络编程 BIO-NIO-AIO资料源码
- jsp讲解
- 基于SSH框架的JavaWeb项目—人员信息管
- javaweb实现的邮件收发系统(附数据库
- Java 仿QQ(附客户端以及服务端源码)
- Java TCP IP Socket
- java定时发送邮件(基于quartz)
- Java Swing开发的《星际争霸》游戏
- java+数据库商品交易管理系统(附数据
- 使用java语言编译一个计算器
- java swing工资管理系统(源码+数据库
- JAVALibrary
- 微信企业号回调模式Java版
- 顺丰丰桥接口开发详细教程源码含下
- Java博客概要设计文档
- 药品进销存管理系统(论文范文_JSP
- 奖学金管理系统java+jsp+mysql
- 毕设参考——基于java酒店管理
- Java写的一个简单的字体更改程序
- java8学习教程之lambda表达式的使用方法
评论
共有 条评论