• 大小: 755KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-06-30
  • 语言: Java
  • 标签: JAVA  eclipse  

资源简介

这是一个功能相对全的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-base
     目录           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-base
     目录           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-base
     目录           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-base
     目录           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-base
     目录           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-base
     目录           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-base
     文件        1977  2013-09-07 17:32  monolithandroid-read-only\.svn\pristine\13\13e289716b8a23f0a12c7c6296a866e648da0e64.svn-base
     目录           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-base
     目录           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-base
     目录           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-base
     目录           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-base
     目录           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-base
     目录           0  2013-09-07 17:32  monolithandroid-read-only\.svn\pristine\2b\
............此处省略207个文件信息

评论

共有 条评论