Game
数据格式
{
"map":[
[0,0,0,0,0,0,0,1],
[0,1,0,0,0,0,0,1],
[0,0,3,0,0,0,0,1],
[0,0,0,0,0,0,0,1]
],
"player_count": 4,
"player_id": [2013, 2124, 1084, 11],
"player_pos": [
[1,2],
[3,4],
[10, 0],
[9, 8]
]
}
{
"round": 1,
"player_count": 4,
"player_id": [2013, 2124, 1084, 11],
"player_action": [0,1,2,3],
"item_count": 2,
"item_properties": [
[
"type": "bomb",
"data": [
"pos": [1,2],
"action": 0,
"range": 11
]
],
[
"type": 2,
"data": [
"pos": [1,2],
"action": 0,
]
]
],
"dead":{
[
"player_id": 1,
"reason": -10001
],
[
"player_id": 2,
"reason": -10003
]
}
}
- 前端处理顺序
- 读入init.json
- 按照每回合的json,处理items
- 处理完所有事件,读取排名
程序模块
- Runner(用来运行游戏规则的东西)
- Gamer(用户的程序)
- Guarder(守护进程)