📄 gamehigh.java
字号:
case EM_NEWCELLDOWN: //新单元落地
{
// if(OurGameNow==false || chair1==MyChair)
// break;
if(chair1==MyChair)
break;
byte num=arg0.getByte();
if(num<0 || num>10)
break;
busyRun=true;
for(byte j=0;j<num;j++)
{
byte a=arg0.getByte();//落点X
byte b=arg0.getByte();//落点Y
byte c=arg0.getByte();//典型索引号
byte d=arg0.getByte();//具体索引号
byte e=arg0.getByte();//等级
m_play[chair1].setnowstyle(c);
m_play[chair1].SetCenterinfo(a,b,d);
m_play[chair1].setbindown();
m_play[chair1].m_level=e;
m_play[chair1].checkline();
// if(MyChair==0){
// System.err.println("=====================================");
// System.err.println("收到"+chair1+"号玩家的方块:"+a+" "+b+" "+c+" "+d+" "+e);
// }
}
// System.err.println("收到"+chair1+"的"+num+"个落地单元.............");
busyRun=false;
// if(MyChair==0){
// System.err.println("-------------------------------------");
// for(int y=inity;y<=MAXCENG;y++)
// {
// for(int x=1;x<=MAXROWS;x++)
// {
// System.err.print(m_play[chair1].bin1[y][x]+" ");
// }
// System.err.println();
// }
// System.err.println("=====================================");
// }
ReflashOtherArea(true);
}
break;
case EM_ADDCENG_BACK:
byte num1=arg0.getByte();
// System.err.println(MyChair+"收到"+chair1+"号要加"+num1+"层");
busyRun=true;
m_play[chair1].AddBottomCell(num1);
busyRun=false;
ReflashOtherArea(true);
break;
case EM_ADDCENG://收行时的加行,发送方已经排除同组玩家
{
byte num=arg0.getByte();
// System.err.println(MyChair+"收到"+chair1+"发给自己的加"+num+"层");
if(MyGameNow==false)
break;
busyRun=true;
if(CellDownNum!=0){
SendCellDown(CellDownNum,
newcella,
newcellb,
newcellc,
newcelld,
newcelle);
CellDownNum=0;
}
m_play[MyChair].AddBottomCell(num);
busyRun=false;
zd_init(chair1,(byte) 3);
SendAddbackCeng(num);
ReflashGameArea(true);
// ReflashOtherArea(true);
}
break;
case EM_PROP://自己被用道具
if(MyGameNow==false)
break;
// byte Tochair1=arg0.getByte();
byte daojustyle1=arg0.getByte();
gm.logGameTools(m_play[chair1].m_actorinfo.getNickName(),m_play[MyChair].m_actorinfo.getNickName(),tool_name[daojustyle1-80]);
// System.err.println(MyChair+"收到自己被使用道具发送人"+chair1+" 是"+daojustyle1+"号");
zd_init(chair1,(byte)3);
if(CellDownNum!=0){
SendCellDown(CellDownNum,
newcella,
newcellb,
newcellc,
newcelld,
newcelle);
CellDownNum=0;
}
this.UserSwitch(MyChair,daojustyle1);
SendDaojutoall(daojustyle1);
ReflashGameArea(false);
ReflashOtherArea(true);
break;
case EM_PROP_TOOL://别人被用道具
{
if(chair1==MyChair)
break;
byte daojustyle=arg0.getByte();
// System.err.println(MyChair+"收到"+chair1+"号被使用道具"+daojustyle+"号");
busyRun=false;
this.UserSwitch(chair1,daojustyle);
ReflashOtherArea(true);
}
break;
case EM_ALLFK://接受到玩家的方块
int num=arg0.getByte();
// System.err.println(MyChair+"收到玩家方块信息1..."+num);
int temp_dw[]=new int[num];
//
byte ss=0;
for(int i=0;i<num;i++){
temp_dw[i]=arg0.getByte();
// System.err.println(MyChair+"收到玩家方块信息 temp_dw[i]="+temp_dw[i]+" "+i);
for (int y = MAXCENG; y>=2; y--)
{
for (int x = 1; x <= MAXROWS; x++)
{
ss=arg0.getByte();
if(ss>0){
ss=50;
}
m_play[temp_dw[i]].bin1[y][x]=ss;
// System.err.println("收到="+ss);
}
}
m_play[temp_dw[i]].Playerstate=PLAYNOW;
// System.err.println(MyChair+"收到玩家方块信息结束 存入 "+ss);
}
ReflashOtherArea(true);
break;
}
busyRun=false;
}
//--------------对战类游戏通用变量-------------------//
private GameManager gm=null; //游戏管理
private GameData m_play[]=null; //创建6位玩家
private Random m_randplay=null; //随机数生成器
private boolean gamemyself=false;
private boolean AfficheMode=false;
private boolean NowMenuOpen=false;
private StringBuffer LowCoinExitText=new StringBuffer();
// private MyShowNum m_shownum = null;
private Font font = Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_PLAIN,Font.SIZE_SMALL);
// private int chatindex=0;
private int m_uiddata[]=new int[player_num];
private int m_coindata[]=new int[player_num];
// private String SysChatText[]=null; //预设聊天语句
// private int ChatTextleftx=0; //预设文字显示坐标
// private int ChatTextfirst=1; //预设当前页首行的索引
// private int ChatTextPage=0; //预设一页显示多少行
// private int ChatTextSelIndex=1; //预设文字选中索引
// private int ChatTextMoveFlag=-3; //预设文字移动量
private StringBuffer ChatShow=null; //聊天信息
private int ChatLength=0; //聊天信息文字长度
private int ChatInfoShowx=0; //聊天栏信息坐标
private byte gamenums=0; //在玩数量
private byte havenums=0; //入座数量
private boolean havebody[]=null; //入座标志
private boolean losebody[]=null; //已输标志
private boolean OurGameNow=false; //当前局是否在玩
private boolean MyGameNow=false; //己方本局是否在玩
private boolean MyLookOn=false; //己方是否是旁观者
private boolean SysChatMode=false; //是否是大厅维护显示聊天信息
private boolean ThisGamePlayed=false; //己方当前局是否参与过
private boolean MeRealHandup=false; //举手实际成功标志
private boolean HasAskret=true; //接收数据是否完成
private byte MyTeam=0; //己方队伍号等于m_play[MyChair].m_team
private byte MyLines=0; //己方收行数
public byte MyChair=-1; //己方凳子号,等于m_play[MyChair].m_chair
private byte MyLevel=0; //己方等级
private byte Index10To0=0; //10秒倒数
private byte Indexgogo=0; //GO计数
private byte AutoExit=0; //自动关闭消息框
private byte Exitflag=1; //退出询问框选中标志
private byte GameMenuIndex=1; //游戏菜单选择
public byte CellDownNum=0; //累计指定数量单元后发送落地消息
private byte NowKeyDOWN=0; //按键是否按下,0:无键按下,1:左键按下,2:右键按下,3:下键按下
private int MyLastScen=0; //进入菜单前的场景,菜单返回时恢复
//延时变量
private byte ShowDelay=0; //聊天信息延时滚动秒数
private byte ScoreDelay=0; //得分界面延时响应秒数
private byte m_delay=0; //主逻辑频率
private byte m_tmpdelay=0; //主逻辑处理频率备份,用于结束连续移动后松开键盘时恢复之前的主逻辑频率
private byte m_delayview=0; //预览区刷新率
// private byte m_delayinfo=0; //道具区或信息区刷新率
private byte m_delaygamearea=0; //游戏区刷新率
private byte m_delayotherarea=0; //其他玩家游戏区频率
//==================================特定变量========================================//
private Graphics m_gamearea=null; //各游戏区绘制环境
private Graphics m_gameother=null;
private Graphics m_viewarea=null;
// private Graphics m_infoarea=null;
private Graphics m_bottomarea=null;
private Image m_leftback=null; //各游戏区背景缓冲
private Image m_gameback=null;
private Image m_viewback=null;
// private Image m_infoback=null;
private Image m_bottomback=null;
public int bombindex=0; //粒子爆炸点原始规格数量
public byte bombpoint[][]= null; //粒子爆炸点原始规格坐标
private boolean m_boolfxpoint=false; //粒子动画是否在运行
public MyFxPointManage m_fxpoint= null;//粒子动画管理对象
private byte Mystyle=-1; //当前动态单元类型 (典型)
private byte nextstyle=-1; //当前预览单元类型1(典型)
private byte nextstyle2=-1; //当前预览单元类型2(典型)
private int areawidth=0; //其他玩家游戏单元区
private int areaheight=0;
private int areax=0;
private int areay=0;
private int aready=0;
public int CELL_SIZE=0; //单元在游戏区尺寸
// private int CELL_SIZE2=0; //单元在预览区尺寸
private int LEFTAREA_LEFT=0; //其他玩家区坐标
private int LEFTAREA_TOP=0;
public int LEFTAREA_HEIGHT=0; //其他玩家区尺寸
private int LEFTAREA_WIDTH=0;
private int draw_leftarea_left=0; //其他玩家区坐标
private int draw_leftarea_top=0;
private int draw_leftarea_height=0; //其他玩家区尺寸
private int draw_leftarea_width=0;
private int draw_leftarea_x=0;
private int draw_leftarea_y=0;
public int draw_game_width=0;
public int draw_game_height=0;
public int GAMEAREA_LEFT=0; //己方游戏区坐标
public int GAMEAREA_TOP=0;
private int GAMEAREA_WIDTH=0; //己方游戏区尺寸
public int GAMEAREA_HEIGHT=0;
private int VIEWAREA_LEFT=0; //预览区坐标,尺寸
private int VIEWAREA_WIDTH=0;
private int VIEWAREA_HEIGHT=0;
private int draw_viewarea_width=0;
private int draw_viewarea_height=0;
// private int INFOAREA_TOP=0;
// private int INFOAREA_HEIGHT=0;
public int CHATSHOWAREA_TOP=0; //聊天信息区坐标尺寸
public int CHATSHOWAREA_WIDTH=0;
public int CHATSHOWAREA_HEIGHT=0;
// private int CHATBUTT_LEFT=0; //聊天框按钮坐标,尺寸
// private int CHATBUTT_SIZE=0;
private int textwidth=0;
private int textheight=0;
// private byte maxdata[]=new byte[player_num];
private byte addchair[]=new byte[player_num];
private byte addceng[]=new byte[player_num];
private byte newcella[]=new byte[player_num];
public byte newcellb[]=new byte[player_num];
private byte newcellc[]=new byte[player_num];
private byte newcelld[]=new byte[player_num];
private byte newcelle[]=new byte[player_num];
public GameHigh()
{
super();
busyRun=false;
loadBuffer("/els176js.boq");
initLoadFrame();
loadAllFrames();
finishLoadFrame();
releaseBuffer();
loadMusic("/game.bqm");
finishLoadFrame();
setDefaultGameKey();
}
//========================普通功能函数=========================//
private void InitGame() {
currentScenario=0;
busyRun=true;
LowCoinExitText.delete(0,LowCoinExitText.length());
// NowMenuOpen=false;
AfficheMode=false;
gamemyself=false;
TeamSelMenuIndex = 1;
timeadd=0;
duiwu_judge=false;
gm=null; //游戏管理
m_play=null; //创建6位玩家
m_randplay=null; //随机数生成器
// SysChatText=null; //预设聊天语句
// ChatTextleftx=0; //预设文字显示坐标
// ChatTextfirst=1; //预设当前页首行的索引
// ChatTextPage=0; //预设一页显示多少行
// ChatTextSelIndex=1; //预设文字选中索引
// ChatTextMoveFlag=-3; //预设文字移动量
ChatShow=null; //聊天信息
ChatLength=0; //聊天信息文字长度
ChatInfoShowx=0; //聊天栏信息坐标
gamenums=0; //在玩数量
havenums=0; //入座数量
havebody=null; //入座标志
losebody=null; //已输标志
DaoJuToIndex=0; //道具受用方索引
OurGameNow=false; //当前局是否在玩
MyGameNow=false; //己方本局是否在玩
MyLookOn=false; //己方是否是旁观者
SysChatMode=false; //是否是大厅维护显示聊天信息
ThisGamePlayed=false; //己方当前局是否参与过
MeRealHandup=false; //举手实际成功标志
MyLevel=0;
MyLines=0;
MyChair=-1; //己方凳子号等于m_play[MyChair].m_chair
MyTeam=0; //己方队伍号等于m_play[MyChair].m_team
Index10To0=0; //10秒倒数
Indexgogo=0; //GO计数
AutoExit=0; //自动关闭消息框
Exitflag=1; //退出询问框选中标志
GameMenuIndex=1; //游戏菜单选择
CellDownNum=0; //累计指定数量单元后发送落地消息
NowKeyDOWN=0; //按键是否按下,0:无键按下,1:左键按下,2:右键按下,3:下键按下
MyLastScen=0; //进入菜单前的场景,菜单返回时恢复
ShowDelay=0; //聊天信息延时滚动秒数
ScoreDelay=0; //得分界面延时响应秒数
m_delay=0; //主逻辑频率
m_tmpdelay=0; //主逻辑处理频率备份,用于结束连续移动后松开键盘时恢复之前的主逻辑频率
m_delayview=0; //预览区刷新率
// m_delayinfo=0; //道具区或信息区刷新率
m_delaygamearea=0; //游戏区刷新率
m_delayotherarea=0; //其他玩家游戏区频率
MyDJAddSpeed=0; //加速道具作用秒数
MyDJDecSpeed=0; //减速道具作用秒数
//======================================变量========================================//
m_gamearea=null; //各游戏区绘制环境
m_gameother=null;
m_viewarea=null;
// m_infoarea=null;
m_bottomarea=null;
m_leftback=null; //各游戏区背景缓冲
m_gameback=null;
m_viewback=null;
// m_infoback=null;
m_bottomback=null;
bombindex=0; //粒子爆炸点原始规格数量
bombpoint= null; //粒子爆炸点原始规格坐标
m_boolfxpoint=false; //粒子动画是否在运行
m_fxpoint= null; //粒子动画管理对象
Mystyle=-1; //当前动态单元类型 (典型)
nextstyle=-1; //当前预览单元类型1(典型)
nextstyle2=-1; //当前预览单元类型2(典型)
areawidth=0; //其他玩家游戏单元区
areaheight=0;
areax=0;
areay=0;
aready=0;
textwidth=0;
textheight=0;
CELL_SIZE=0; //单元在游戏区尺寸
LEFTAREA_LEFT=0;
LEFTAREA_TOP=0;
LEFTAREA_HEIGHT=0; //其他玩家区尺寸
LEFTAREA_WIDTH=0;
GAMEAREA_LEFT=0; //己方游戏区坐标
GAMEAREA_TOP=0;
GAMEAREA_WIDTH=0; //己方游戏区尺寸
GAMEAREA_HEIGHT=0;
VIEWAREA_LEFT=0; //预览区坐标,尺寸
VIEWAREA_WIDTH=0;
VIEWAREA_HEIGHT=0;
CHATSHOWAREA_TOP=0; //聊天信息区坐标尺寸
CHATSHOWAREA_WIDTH=0;
CHATSHOWAREA_HEIGHT=0;
// CHATBUTT_LEFT=0; //聊天框按钮坐标,尺寸
// CHATBUTT_SIZE=0;
// ------------------------------
// zd_judge=0; //绘制炸弹 1:满级发送 2:连销发送 3:接到
for(int i=0;i<player_num*2;i++){
zd_x[i]=0;//绘制炸弹xy
zd_y[i]=0;
}
for(int i=0;i<player_num;i++){
zd_xy[i]=false;
bz_num[i]=0; //炸弹动画的帧数
zd_judge[i]=0;
}
zd_judge_bool=false;
del_move=0; //消失抖动
llt=0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -