别的玩家,手中有没有牌 目前没有显示。
我们做一个别的玩家。手中显示牌。

我们手中的牌在中间。 别的玩家的牌在头像旁边 。

onLoad () {
global.gameEventListener.on("change_house_manager", this.changeHouseManager.bind(this));
//接受牌的消息
global.gameEventListener.on("push_card", this.pushCard.bind(this));
},
pushCard(){
console.log("player-node-js-----pushCard");
if(this.getClientId()===global.client.id){
//自己这里不用再发牌了,不用在自己的头像。发牌了。
return;
}
this.cardNodeList = [];
for(let i=0;i<3;i++){
var cardNode = cc.instantiate(this.card_node_prefab);
cardNode.parent = this.node;
let x = 80 * (3-1) * -0.5 +80 * i ;
let y = 0 ;
var pos = cc.v2(x,y);
cardNode.setPosition(pos);
this.cardNodeList.push(cardNode);
}
},



站长微信:xiaomao0055
站长QQ:14496453