87,984
社区成员
发帖
与我相关
我的任务
分享
var housegame = function (num) {
this.players = {players:[]};//记录有多少位玩家玩家
this.player = {//玩家属性
name:"default",
money:"10",
landCount:0,
land:[],
landKey:0,
color:"#fff",
}
this.color = ["rgb(235, 110, 98)","rgb(249, 163, 108)","rgb(245, 173, 85)","rgb(50, 184, 176)","rgb(130, 148, 160)","rgb(129, 210, 238)","rgb(193, 153, 209)"];
this.init = function (options, onClose) {// 初始化游戏
//记录玩家数量 start
for(var i = 0;i < num;i++){
this.player.name = "player"+(i+1);
this.player.color = this.color[i+1];
this.players.players.push(this.player);
}
//记录玩家数量 end
};
// 更换主题
this.Ctheme =function(theme){
}
}

this.init = function (options, onClose) {// 初始化游戏
//记录玩家数量 start
for (var i = 0; i < num; i++) {
this.player = {};//////////////////新对象
this.player.name = "player" + (i + 1);
this.player.color = this.color[i + 1];
this.players.players.push(this.player);
}
//记录玩家数量 end
console.log(this.players)
};