> (狼人杀)游戏,游戏策划
-- 狼人杀Android版- https://github.com/werewolfKill/werewolf_android
狼人杀Server端- https://github.com/werewolfKill/werewolf_server
-- 游戏规则:
* 6人局 ,身份:狼人*2 ;村民*2 ;预言家 守卫
* 9人局(《饭局的诱惑》同款),身份:狼人*3 ;村民*3 ;预言家 女巫 猎人
* 12人局 ,身份:狼人*4 ;村民*4 ;预言家 女巫 猎人 守卫
-- 狼人杀Android版- https://github.com/werewolfKill/werewolf_android
狼人杀Server端- https://github.com/werewolfKill/werewolf_server
-- 仿狼人杀Demo- https://github.com/wzc25151/lrs_android
langren安卓端狼人杀游戏- https://github.com/whu-iss-jack/langren
-- 发牌随机算法,游戏界面绘制,接口通信及通信形式
-- 算法:一维数组随机排列
/**
数组中人物设定 设置为一个type
* 6人局 ,身份:狼人*2 ;村民*2 ;预言家 守卫
*
*/
private void sixBoardMode() {
String sixMode[] = { "Werewolf", "Werewolf", "Villagers", "Villagers", "Prophet", "Guard" };
int length = sixMode.length;
Random random = new Random();
for(int i=0;i<length;i++){
int p = random.nextInt(i+1);
System.out.println("i==="+i+"p==="+p);
String tmp = sixMode[i];
sixMode[i] = sixMode[p];
sixMode[p] = tmp;
}
for(int j=0;j<length;j++){
System.out.println(sixMode[j]);
}
}
> 界面绘制:
SurfaceView Render invalidate Canvas Paint postInvalidate() ;
SurfaceView 与 GLSurfaceView效率!