room.uid
- unique identifier for the roomroom.snakes
- array of snakes
room.apple
- position of apple as a coordinate
room.name
- name of roomroom.size
- size of room (X by X)room.tick
- speed at which snake positions are updates (in milliseconds)room.walls
- array of walls, each wall a coordinate
snake.uid
- unique identifier for each snakesnake.name
- name of snake as appears on the leaderboardsnake.color
- this does nothing yetsnake.bot
- boolean whether snake is a bot or notsnake.loggedIn
- boolean whether the snake is a logged in user or notsnake.directionMap
- translates a string direction to a vector (eg snake.directionMap["up"]
gives you [0,1]
)snake.body
- array of body parts, each part a coordinate
snake.direction
- the current direction of the snakesnake.score
- deprecated use snake.body.length
snake.speed
- does nothing yet, always 0snake.room
- UID of the room that the snake is currently insnake.eating
- boolean wether the snake ate an apple the last ticksnake.creationTime
- timestamp for when the snake we spawned in the roomAll of the following attributes only exist in snakes created by the game
snake.isBot
- always true for game created snakessnake.minMistakesPerTickPercent
- minimum percent of times that the snake makes a mistakesnake.oddsOfMistakePerTick
- odds of whether the snake does not make a mistake. The lower this is the better the snakesnake.inverseMap
- hash map inverting directions. (Eg. up
to down
, left
to right
, etc)snake.shiftInverseMap
- list of valid directions the snake can go if it wants to turn back onto itself. Eg. “up” allows “right” and “left”coordinate[0]
: X valuecoordinate[1]
: Y value