游戏区其实就相当于一个游戏棋室的功能,从图7-4
。如果有人坐在左边就在左边显示一个小人,表示已经有人坐了,同理如果有人坐在右边就显示另一个小人。两个小人的样式如图7-6.检测玩家
首先先让这两个小人全部隐藏,然后在检查到名字变量不为空时就显示小人。
this.gotoAndStop (2);
} else {
this.gotoAndStop (1);
}
}
一张棋盘在源文件中的排列如图
7-7左边的那个文本框是player_left左侧按钮左边按钮的代码:
>求出我在100
m_Message.attributes.VALUE = "http://www.dedecms.com/web-art/pingmianshejiruanjian/Flash/20060528/SIT";
if (player_left == _root.nickname) {
//
//
} else if ((trim(player_left) == "" || player_left == null) && _root.myself.PlayStatus != "SitDown") {
_root.player_left[place] = player_left=_root.nickname;
_root.myself.PlayStatus = "SitDown";
_root.now_sit_table = place;
//不管自己是坐下还是起立,都要发条信息给后台,并由后台进行广播
chatXML.appendChild(m_Message);
trace (chatXML.toString());
// send it!!!
if (_root.now_sit_table == place && player_right != _root.nickname ) {
//
if (trim(player_left) != "" && player_left != null && trim(player_right) != "" && player_right != null) {
//谁拿什么棋,我现在在左边是拿红棋,对手拿右边的蓝棋
_root.my_logo = _root.First_play;
_root.your_logo = _root.Sec>表示玩家正坐在哪张台
_root.now_play_table = place;
//
}
}
}
;
_root.myself.PlayStatus = "StandUp";
m_Message.attributes.PARAM = place+" stand_up "+_root.nickname;
} else if ((trim(player_right) == "" || player_right == null) && _root.myself.PlayStatus != "SitDown") {
_root.player_right[place] = player_right=_root.nickname;
_root.myself.PlayStatus = "SitDown";
_root.now_sit_table = place;
m_Message.attributes.PARAM = place+" right "+player_right;
}
chatXML.appendChild(m_Message);
trace (chatXML.toString());
// send it!!!
if (_root.now_sit_table == place && player_left != _root.nickname) {
_root.chatSocket.send(chatXML);
_root.rival = "";
if (trim(player_left) != "" && player_left != null && trim(player_right) != "" && player_right != null) {
//我在右边拿蓝棋,对手在左边拿红棋
_root.my_logo = _root.Sec>开始下棋
_root.begin_play(_root.nickname,_root.rival);
_root.gotoAndPlay("begin_play");
}
} else {
//
这里的value stand_up表示坐在棋盘左边
处理完之后结果发回给用户:
<SIT VALUE="http://www.dedecms.com/web-art/pingmianshejiruanjian/Flash/20060528/6:stand_up:d>也是分成三个部分,只是其分隔符改成了冒号。
欢迎您访问www.5ucms.org
上一篇:5ucms仿站,Flash MX 编程深层次应用-网络连线游戏(1) 下一篇:5ucms模版,Flash MX 编程深层次应用-Flash射击游戏(7) |
|
本站声明:本网站所载文章等内容,目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如涉及作品内容、版权及其它问题,请在30日内与本网联系(Email:3876307#qq.com),我们将在第一时间删除内容。若原创内容转载请注明出处。 5ucms培训,Flash MX 编程深层次应用-网络连线游戏(2)的关键词: |