1、胡牌动作
2、胡牌的业务逻辑
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -153,6 +153,22 @@ cc.Class({
|
|||||||
inviteplayer:{
|
inviteplayer:{
|
||||||
default:null ,
|
default:null ,
|
||||||
type : cc.Prefab
|
type : cc.Prefab
|
||||||
|
},
|
||||||
|
hu_cards_current:{
|
||||||
|
default:null ,
|
||||||
|
type : cc.Node
|
||||||
|
},
|
||||||
|
hu_cards_top:{
|
||||||
|
default:null ,
|
||||||
|
type : cc.Node
|
||||||
|
},
|
||||||
|
hu_cards_left:{
|
||||||
|
default:null ,
|
||||||
|
type : cc.Node
|
||||||
|
},
|
||||||
|
hu_cards_right:{
|
||||||
|
default:null ,
|
||||||
|
type : cc.Node
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -860,7 +876,6 @@ cc.Class({
|
|||||||
/**
|
/**
|
||||||
* 杠后移除当前手牌,进入到 杠 列表里
|
* 杠后移除当前手牌,进入到 杠 列表里
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for(var inx = 0 ; inx < context.playercards.length ; ){
|
for(var inx = 0 ; inx < context.playercards.length ; ){
|
||||||
let temp = context.playercards[inx].getComponent("HandCards");
|
let temp = context.playercards[inx].getComponent("HandCards");
|
||||||
if(data.cardtype == temp.mjtype && data.cardvalue == temp.mjvalue){
|
if(data.cardtype == temp.mjtype && data.cardvalue == temp.mjvalue){
|
||||||
@@ -870,7 +885,16 @@ cc.Class({
|
|||||||
inx++ ;
|
inx++ ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(data.action == "hu") {
|
||||||
|
//胡牌了,把胡的牌放入到胡牌列表里,然后 , 把当前的玩家的牌局置为不可点击
|
||||||
|
let hu_card = cc.instantiate(context.takecards_one);
|
||||||
|
let temp = hu_card.getComponent("DeskCards");
|
||||||
|
temp.init(data.card);
|
||||||
|
|
||||||
|
context.deskcards.push(hu_card);
|
||||||
|
hu_card.setScale (0.8 , 0.8) ;
|
||||||
|
hu_card.parent = context.hu_cards_current;
|
||||||
|
}else{
|
||||||
let cards_gang;
|
let cards_gang;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -915,6 +939,7 @@ cc.Class({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
context.exchange_state("nextplayer" , context);
|
context.exchange_state("nextplayer" , context);
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ var HTTP = cc.Class({
|
|||||||
// ...
|
// ...
|
||||||
},
|
},
|
||||||
statics: {
|
statics: {
|
||||||
baseURL:"http://192.168.1.155",
|
baseURL:"http://127.0.0.1",
|
||||||
wsURL : "http://192.168.1.155:9081",
|
wsURL : "http://127.0.0.1:9081",
|
||||||
authorization: null,
|
authorization: null,
|
||||||
httpGet: function (url , success , error , object) {
|
httpGet: function (url , success , error , object) {
|
||||||
var xhr = cc.loader.getXMLHttpRequest();
|
var xhr = cc.loader.getXMLHttpRequest();
|
||||||
|
|||||||
Reference in New Issue
Block a user