目录结构调整
This commit is contained in:
322
codes/games/client/Projects/tgly/js/gamemain.js
Normal file
322
codes/games/client/Projects/tgly/js/gamemain.js
Normal file
@@ -0,0 +1,322 @@
|
||||
var gameabc_face = gameabc_face||{};
|
||||
{
|
||||
gameabc_face.tag=12; //定义你的游戏全局内存
|
||||
gameabc_face.tag1=123;//定义你的游戏全局内存
|
||||
gameabc_face.tag2=123;//定义你的游戏全局内存
|
||||
gameabc_face.tag3=123;//定义你的游戏全局内存
|
||||
gameabc_face.dfwgao=1;
|
||||
}
|
||||
|
||||
gameabc_face.gamestart=function(gameid)
|
||||
{
|
||||
//游戏初始化代码
|
||||
//utlinitgame();
|
||||
GameOS = fBrowserRedirect();
|
||||
C_Block.create();
|
||||
g_board = new Board();
|
||||
g_player = new Player();
|
||||
g_game = new Game();
|
||||
//-----初始化
|
||||
g_board.create(RAW,COL,boardspbeg);
|
||||
invisible();
|
||||
set_group(24,37,1,0,0);
|
||||
startload();
|
||||
//var Third = FeiYou;
|
||||
//Third.Login(Login_Succ, Login_Fail);
|
||||
|
||||
|
||||
//require(['yl'], function(yl) {
|
||||
//yl.yl_getUserInfo(setUserInfo);
|
||||
//});
|
||||
|
||||
};
|
||||
|
||||
//登录成功
|
||||
function Login_Succ(_obj_data) {
|
||||
set_group(24,37,1,0,0);
|
||||
startload();
|
||||
InputInfo = _obj_data;
|
||||
//InputInfo.userid = parseInt(InputInfo.userid);
|
||||
}
|
||||
//登录失败
|
||||
function Login_Fail(_str_error) {
|
||||
//alert(_str_error);
|
||||
}
|
||||
//function setUserInfo(userInfo){
|
||||
//if(userInfo!=null){
|
||||
//tempNickName = decodeURI(userInfo.nickName);
|
||||
//tempWxImg = userInfo.headImg;
|
||||
//tempId = userInfo.openId;
|
||||
//}else{
|
||||
//require(['yl'], function(yl) {
|
||||
//yl.yl_goAuth();
|
||||
//});
|
||||
//}
|
||||
//}
|
||||
gameabc_face.ani_doend=function(id,sx,count,allend)
|
||||
{
|
||||
//logmessage(id+"/"+sx+"/"+count+"/"+allend);
|
||||
//play_ani(0,2,18,50,200,0,1000,0,0,0,0,6000,1);//主动关闭
|
||||
utlani_doend(id,sx,count,allend);
|
||||
};
|
||||
|
||||
gameabc_face.box_doend=function(id,sx,timelen)
|
||||
{
|
||||
//play_box 结束事件
|
||||
//showmessage("box_doend:"+id+"/"+sx+"/"+timelen);
|
||||
//logmessage("box_doend:"+id+"/"+sx+"/"+timelen);
|
||||
};
|
||||
function setWxInfo(name,userid,headimg){
|
||||
Func.up_imgurl(30,headimg);
|
||||
g_player.setWxInfo(name,userid,headimg);
|
||||
set_rec(150,name);
|
||||
}
|
||||
gameabc_face.onloadurl=function(recid,rectype,url,error,count,len)
|
||||
{
|
||||
//修改为gameabc_face.onloadurl 则自己处理图片加载进度
|
||||
//资源加载完成函数
|
||||
//recid:资源id
|
||||
//rectype:1 图片 2声音
|
||||
//url :网络地址
|
||||
//error:是否加载错误
|
||||
//len:资源大小
|
||||
//count:加载的个数百分比
|
||||
|
||||
//logmessage("onload:"+recid+"/"+rectype+"/"+count+"/"+error);
|
||||
|
||||
|
||||
if (rectype==0)
|
||||
{
|
||||
ifast_loadsprite(PRIORLOAD);
|
||||
//open_load("","1.mp3","");
|
||||
//gameabc_face.randombase=0;//使用系统浏览器缓存
|
||||
set_windows(2,"var",1977);
|
||||
}
|
||||
|
||||
if (count==100)
|
||||
{
|
||||
//set_rec(141,tempNickName);
|
||||
//up_imgurl(30,tempWxImg);
|
||||
set_self(345,37,0,0,0);
|
||||
//up_imgurl(116,"http://v1.qzone.cc/avatar/201503/14/19/00/550414c7d20f4351.jpg%21200x200.jpg");
|
||||
endload();
|
||||
//game_close_zsmsg("");
|
||||
//utlinitgame();
|
||||
//setWxInfo("http://pic32.nipic.com/20130829/12906030_124355855000_2.png","124");//载入微信头像和昵称信息 0->头像资源 1->昵称
|
||||
|
||||
} else
|
||||
{
|
||||
//game_open_zsmsg(count+"%"+" 加载中...");
|
||||
loadcount = count;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.chongzhi=function(userid,zt,data)
|
||||
{
|
||||
//游戏接口代码
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.onresize=function(pmw/*屏幕宽*/,pmh/*屏幕宽*/,sjweww/*设计宽*/,sjnewh/*设计宽*/,nweww/*显示宽*/,newh/*显示高*/)
|
||||
{
|
||||
|
||||
//屏幕变化
|
||||
// 在此调整 列表控件的宽高和区域 不是整体缩放
|
||||
//logmessage("onresize:"+pmw+"/"+pmh+"/"+sjweww+"/"+sjnewh+"/"+nweww+"/"+newh);
|
||||
};
|
||||
|
||||
gameabc_face.gamebegindraw=function(gameid, spid, times, timelong)
|
||||
{
|
||||
//更新开始代码
|
||||
|
||||
//set_clip(316,0,0,0,(LOAD_W/100)*loadcount,LOAD_H);
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.gameenddraw=function(gameid, spid, times, timelong)
|
||||
{
|
||||
//更新完成代码
|
||||
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.mousedown=function(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6)
|
||||
{
|
||||
//点击代码
|
||||
utlmousedown(gameid, spid, downx, downy);
|
||||
};
|
||||
|
||||
gameabc_face.mousedown_nomove=function(gameid, spid, downx, downy, timelong, no1, no2, no3, no4, no5)
|
||||
{
|
||||
//点击代没移动代码
|
||||
utlmousedown_nomove(gameid, spid, downx, downy, timelong);
|
||||
};
|
||||
|
||||
gameabc_face.mouseup=function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2)
|
||||
{
|
||||
//点击弹起代码
|
||||
//可以通过spid_down和spid_up 的比较 来判断是 点击还是 移动
|
||||
|
||||
utlmouseup(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2);
|
||||
};
|
||||
|
||||
gameabc_face.mousemove=function(gameid, spid, downx, downy, movex,movey ,timelong,offmovex, offmovey, no1)
|
||||
{
|
||||
//logmessage("movex = "+movex+" movey = "+movey+" downx = "+downx+" downy = "+downy);
|
||||
//if(movex==downx&&movey==downy){
|
||||
//return ;
|
||||
//}
|
||||
|
||||
//点击后移动代码
|
||||
//set_self(spid,18,offmovex,1,0);
|
||||
//set_self(spid,19,offmovey,1,0);
|
||||
//switch(spid){
|
||||
//case 4:
|
||||
//set_group(4,18,offmovex,1,0);
|
||||
//set_group(4,19,offmovey,1,0);
|
||||
//break;
|
||||
//}
|
||||
utlmousemove(gameid, spid, downx, downy, movex,movey ,timelong,offmovex, offmovey);
|
||||
};
|
||||
|
||||
gameabc_face.gamemydraw=function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7)
|
||||
{
|
||||
//每个精灵更新绘画代码
|
||||
utlgamemydraw(gameid, spid, times, timelong);
|
||||
//var w = get_self(119,7,0,0,0).length*wscore;
|
||||
//set_self(119,18,(720-w)/2,0,0);
|
||||
//set_self(119,20,w,0,0);
|
||||
};
|
||||
|
||||
gameabc_face.gamemydrawbegin=function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7)
|
||||
{
|
||||
//每个精灵更新前绘画代码
|
||||
//logmessage("begin spid = "+spid);
|
||||
//if(spid==215){
|
||||
//var pos=get_self(spid,18,0,0,0);
|
||||
//if(pos<80){
|
||||
//set_clip(spid,0,80-pos,0,140-80+pos,58);
|
||||
//}
|
||||
//}ifast_mydrawbmp(spid,72,8,8,(LOAD_W/100)*loadcount,LOAD_H,0,0,((LOAD_W-40)/100)*loadcount,LOAD_H);
|
||||
if(spid == 149){
|
||||
set_clip(149,0,0,0,((LOAD_W-90)/100)*loadcount,LOAD_H);
|
||||
}
|
||||
};
|
||||
|
||||
gameabc_face.ontimer= function(gameid, spid, /* 本次间隔多少次了 */ times, /* 本次间隔多久 */ timelong,/* 开启后运行多少次了 */ alltimes){
|
||||
/*请在下面输入您的代码
|
||||
*/
|
||||
//set_self(1,18,5,1,0);
|
||||
utlontimer(gameid, spid, /* 本次间隔多少次了 */ times, /* 本次间隔多久 */ timelong,/* 开启后运行多少次了 */ alltimes);
|
||||
|
||||
} ;
|
||||
|
||||
gameabc_face.tcpconnected=function(tcpid)
|
||||
{
|
||||
/*
|
||||
ifast_tcp_open(1,"127.0.0.1:5414");//连接ws tcp
|
||||
*/
|
||||
//logmessage("tcpopen:"+tcpid);
|
||||
|
||||
|
||||
};
|
||||
gameabc_face.tcpmessage=function(tcpid,data)
|
||||
{
|
||||
//logmessage("tcpread:"+data);
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.tcpdisconnected=function(tcpid)
|
||||
{
|
||||
//logmessage("tcpclose:"+tcpid);
|
||||
|
||||
|
||||
};
|
||||
gameabc_face.tcperror=function(tcpid,data)
|
||||
{
|
||||
//logmessage("tcperror:"+tcpid);
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.httpmessage=function(myid,url,data)
|
||||
{
|
||||
/*
|
||||
ifast_http(1,"web/test.txt",1);//获取文件 同域
|
||||
*/
|
||||
//logmessage("httpread:"+myid+"/"+url+":"+data);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user