Add play field size metrics
This commit is contained in:
parent
64d4eb0344
commit
d9308e8753
1 changed files with 4 additions and 4 deletions
|
@ -96,8 +96,8 @@ def main():
|
|||
|
||||
class Game():
|
||||
def __init__(self):
|
||||
self.x = 0
|
||||
self.y = 0
|
||||
self.x = Gauge("x_resolution", "X resolution of the play field")
|
||||
self.y = Gauge("y_resolution", "Y resolution of the play field")
|
||||
self.food_decay_per_frame = 0
|
||||
self.users = UserList()
|
||||
self.uptime = Summary("api_up", "Status of the server API")
|
||||
|
@ -116,8 +116,8 @@ class Game():
|
|||
name = bot.get("name")
|
||||
self.users.update_by_name(name, data=bot)
|
||||
elif typ == MESSAGES["GameInfo"]:
|
||||
game.x = js.get("world_size_c")
|
||||
game.y = js.get("world_size_y")
|
||||
game.x.set(js.get("world_size_x"))
|
||||
game.y.set(js.get("world_size_y"))
|
||||
elif typ == MESSAGES["BotKill"]:
|
||||
try:
|
||||
victim = self.users.get_user_by_worm(js.get("victim_id"))
|
||||
|
|
Loading…
Reference in a new issue