⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 block.gml

📁 在线游戏最新服务器端源代码
💻 GML
字号:
#define NETDEBUG 1
#define PORT 6660

<style>
.textbtnc:text{
	btncolor=#CBB99C;
	showstyle=insert;
	OnCreate={<: bkimg=btnup($[btncolor])>};
	color=0;align=center,center;
	//font=Impact,16;anti=true;
	OnLButtonDown={<: showstyle=insert;bkimg=btndown($[btncolor])>};
	OnLButtonUp={<: showstyle=insert;bkimg=btnup($[btncolor]);event=click>};
	OnMouseOver={<: showstyle=0;bkimg=btnup($[btncolor])>};
	OnmouseOut={<: showstyle=insert;bkimg=btnup($[btncolor])>};
}
.btn_t:div{
	size=100,60;
	bkimg=dark(6);
	align=center,center;
	OnCreate={<: pos=(pid.width-width)/2,(pid.height-height)/2;>
		<text font=Impact,10,24,800;color=#3399FF;anti=1;align=center,center;pos=pid.width/2,pid.height/2;src=$[txt]>};
	paramCtrl=loopcmd(-1,1,200,{<: bk=(bk+1);if=(bk>6)?{bk=0};bkimg=dark(bk)>});
//	OnLButtonDown={<: showstyle=insert>};
//	OnLButtonUp={<: showstyle=insert;event=click>};
//	OnMouseOver={<: showstyle=0>};
//	OnmouseOut={<: showstyle=insert>};
}
.msgbox:div{
	pid=desktop;
	bkimg=$.\images\dlgbk.gif#3,3;
	name=msgdlg;
	size=280,92;
	zorder=top;
	OnSize={<: pos=(pid.width-width)/2,(pid.height-height)/2>};
	eve=size;
	class=dragclass;
	tt=10;
//	paramCtrl=loopcmd(-1,1000,1000,{<: ?*tt;tt=(tt-1);if=(tt<1)?{eve=next}>});
//	draw={wv();textout($[tt],100,70,#000000)};
	OnCreate={
		<text anti=true;align=center,center;color=#FFFFFF;
		font=隶书,11,22;zorder=top;
		OnSize={<: pos=pid.width/2+1,24+1>};
		eve=size;
		srcex=*pid.src;
		OnCreate={<: pid.txt=*id>};
		>
		<text anti=true;align=center,center;color=0;
		font=隶书,11,22;zorder=top;
		OnSize={<: pos=pid.width/2,24>};
		eve=size;
		srcex=*pid.src;
		OnCreate={<: pid.txt=*id>};
		>
	};
}
.msg_in:msgbox{
	OnCreate#b={<: paramCtrl=loopcmd(-1,1000,1000,{<: tt=(tt-1);if=(tt<1)?{eve=ok}>})>
		<textbtnc src="接受";pos=pid.width/2-20,pid.height-16;OnClick={<: pid.eve=ok>}>
		<textbtnc src="拒绝";pos=pid.width/2+20,pid.height-16;OnClick={<: pid.eve=cancel>}>}
	Onok={<: del=1><:desktop playid.eve=yes>};
	Oncancel={<: del=1><:desktop playid.eve=nofight>};
}
.msg_over:msgbox{
	OnCreate#b={<: paramCtrl=loopcmd(-1,1000,1000,{<: tt=(tt-1);if=(tt<1)?{eve=ok}>})>
		<textbtnc src="继续玩会";pos=pid.width/2-40,pid.height-16;OnClick={<: pid.eve=ok>}>
		<textbtnc src="退出";pos=pid.width/2+20,pid.height-16;OnClick={<: pid.eve=cancel>}>}
	Onok={<: del=1><:desktop playid.eve=next>};
	Oncancel={<: del=1><:desktop playid.eve=quit>};
}
.msg_wait:msgbox{
	OnCreate#b={<: paramCtrl=loopcmd(-1,1000,1000,{<: tt=(tt-1);if=(tt<1)?{del=1}>})>
	<textbtnc src="退出";pos=pid.width/2+20,pid.height-16;OnClick={<: pid.eve=cancel>}>}
	Oncancel={<: del=1><:desktop playid.eve=quit>};
}
.msg_info:msgbox{
	OnCreate#b={<: paramCtrl=loopcmd(-1,1000,1000,{<: tt=(tt-1);if=(tt<1)?{del=1}>})>
	<textbtnc src="关闭";pos=pid.width/2+20,pid.height-16;OnClick={<: pid.eve=cancel>}>}
	Oncancel={<: del=1>};
}
.seemode{
	mode=0;
}
.playmode{
	mode=1;
	stop=0;
}
.stopmode{
	mode=0;
	stop=1;
	stop=0;
	stop=1;
}
.fenText:Text{
	font=Impact,8,18,100;
	//showstyle=1;
	anti=0;
	align=center,center;
	clip=0;
}
.blockbase:block{
	blcolor=1,#33CC99;
	blcolor=2,#0099CC;
	blcolor=3,#CC3366;
	blcolor=4,#FF9966;
	blcolor=5,#990066;
	blcolor=6,#999999;//其他人看

//	snd=0,$.\sound\pocket.gsm;//down
//	snd=1,$.\sound\click.gsm;//move
	snd=2,$.\sound\rotate.gsm;//roto
	snd=4,$.\sound\sentout.gsm;//delline
	snd=3,$.\sound\good.gsm;//delbig
	snd=5,$.\sound\downover.gsm;//down
	snd=6,$.\sound\gameover.gsm;//gameover

	snd=7,$.\sound\h1.gsm;//h1
	snd=8,$.\sound\h2.gsm;//h1
//	snd=9,$.\sound\gameover.gsm;//h1

	snd=10,$.\sound\wan.gsm;//wan
//	snd=11,$.\sound\gameover.gsm;//wan
//	snd=12,$.\sound\gameover.gsm;//wan

	netdelay=1000;
//	downspeed=700;
	size=192,364;
	class=seemode;
	fen=2000;
	dellines=0;
	sendlines=0;
//	debug=1;
//	snd=0,$.\sound\pocket.gsm;//down
	snd=1,$.\sound\click.gsm;//move
//	snd=2,$.\sound\cue2ball.gsm;//roto
	snd=3,$.\sound\cue2ball.gsm;//delline
	snd=4,$.\sound\bigbreak.gsm;//delbig
	OnDelLine={<: neteventTos=delline,$[ep]>};//;if=($[ep]>1)?{<: eve=Sendline,$[ep]>}>};
//	OnSendline={<:$[otherid] netBroadCast=addlines,$[ep]>}
	OnAddlines={<: addline=ep>};
	OnGameOver={<: neteventTos=lost;stop=1>};
	OnNextsub={<: neteventTos=nextsub;>};
	playname="等待中...";
	OnplayAdd={<: playname=*ep;switch(ep){
		case $[&desktop.playname]:
			class=playmode;{<:desktop bx=$[id]>};
			break;
		}
		>};
	onFen={<: fen=$[ep0];fentxt.src=*fen;dellines=$[ep1];deltxt.src=*dellines;sendlines=$[ep2];sendtxt.src=*sendlines>};
//	OnCreateBtn={<btn_t pid.pb1=*id;txt=加入;
//		OnClick={<:$[&desktop.playid] neteventTos=enter,$[index]>}>};
//	OnplayAdd#2={<: pb1.del=1>};
	OnCreateBtn={<: class=seemode>};
//	OnBegin={<: ?$[name]ll$[playname];mode=1;>};
	OnMatch={<: switch(ep){case $[&desktop.playname]:mode=1};stop=0><:msgdlg del=1>};
	OnUnMatch={<: data=0;mode=0;stop=1;playname="等待中...";eve=fen,0,0,0>};
	OnUser={<: playname=$[ep0];fen=$[ep1]>};
	Onplayquit={<: class=seemode>};
	Oncontinued={<: class=playmode>};
	Onquit={<: neteventTos=quit;>};
	Onquited={<: switch(ep){case $[&desktop.playname]:eve=exit;}>};
	Onexit={top.close()};
}
.txt_Name:text{
	color=#FFFFFF;
	pos=-85,55;
	pid.pname=*id;
}
.btn_Down:textbtn{
	size=100,60;
	pos=(pid.width-width)/2,(pid.height-height)/2;
	show=0;
	OnShow={<: src=$[ep];show=1>};
	OnClick={<:desktop eve=$[src],$[pid.index]>};
}
.btn_Up:textbtn{
	size=40,20;
	pos=0,0;
	show=0;
	OnShow={<: src=$[ep];show=1>};
	OnClick={<:desktop eve=$[src],$[pid.index]>};
}
.man:blockbase{
//	class=gman;
	OnCreate#p={<: if=(index==0)?{pos=102,9;nextpos=-70,111;xp=-60;np=-85}:{
		pos=343,9;nextpos=192+40,111;xp=(192+60);np=228}>
		<txt_Name pos=pid.np,55;pid.pname=*id>
		<btn_Down pid.pb1=*id>
		<btn_Up pid.pb2=*id>
		<fenText pos=pid.xp,195;src="0";pid.fentxt=*id;color=R234G230B110>
		<fenText pos=pid.xp,235;src="0";pid.deltxt=*id;color=R134G230B210>
		<fenText pos=pid.xp,275;src="0";pid.sendtxt=*id;color=R54G220B80>
	};
	mode=0;
	user=0;
	OnMode={<: mode=0;if=($[ep0]==0)?{user="空闲中...";stop=1;eve=btn,0}:{
		user=$[ep1];stop=0;switch(user){case $[&desktop.myname]:mode=1;eve=btn,2;break;default:eve=btn,1}}>};
	ifchged(user)={<: pname.src=$[user]>};
	OnBtn={<: switch(ep){
		case 0:pb1.eve=show,"加入";pb2.show=0;break;
		case 1:pb1.show=0;pb2.show=0;break;
		case 2:pb1.show=0;pb2.eve=show,"旁观";break;
	}>};
	OnEnter={<: eve=mode,1,$[ep]>};
	OnLeave={<: eve=mode,0>};
}
.MyDesk{
	On加入={<:$[me] eve=down,$[ep]>};
	On旁观={<:$[me] eve=up,$[ep]>};
}
.MyManList{
	pos=305,25;
	size=30,45;
	bkimg=null
}
.MyUserList{
	pos=448,379;
	size=185,96;
	zorder=top;
	bkimg=null;
	autosubpos=vert(15,3,1,1,20);
	rightscroll=1;
}
.MyChatList{
	pos=153,378;
	size=285,76;
	bkimg=null;
	zorder=top;
	autosubpos=vert(1,1,0,true,115);
	rightscroll=1;
}
.MyChatEdit{
	size=283,16;
	pos=152,462;
	font=宋体,14;
	textcolor=white;
	bkcolor=#242620;
}
</style>

<img pos=0,0;size=640,480;src=$.\images\blockbk.jpg;zorder=bottom>

//<sys import=desktop,$.\net.gml>
//<sys sethotkey=space,{<:b1 addline=2>};>

<text pos=pid.width/2,pid.height/3;bkimg=dark(2);
 name=helptxt;
 //bkimg=$.\images\dlgbk.gif#3,3;
 font=宋体,12,24;
 anti=true;align=center,center;
 color=#FFFFFF;
 show=0;
 Onclick={<: show=0>};
 srcex="请用方向键<- ->移动\r\n向上键翻转\r\n向下键加速下落";>
<textbtn pos=97,400;
 src=帮助;
 OnClick={<:helptxt show=(1-show);>};
>

<sys import=desktop,$.\base.gml>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -