aalemayhu / snake

[S]uper [N]ot [A]wesome [K]nockout [E]agle - SNAKE - a Twitch snake overlay game
0 stars 1 forks source link

Design a API for the game and implement it #1

Closed aalemayhu closed 6 years ago

aalemayhu commented 6 years ago

@nyasaki made a gist for it, inlined below. This can be used as a basis.

//Every player has the basic actions called [COLLECT, MOVE, ATTACK,HEAL]
//there is a 1s delay between each run through the loop
//View of the creep (0 => creep; numbers => positions):
//1 2 3
//4 0 5
//6 7 8

//The player can ask what at a given position around the creep is
//Example:
//creep.get(2)
//returns id of a object (1 => ressource, 2 => player, 3 => obstacle, etc.)

//There are a fixed amount of ressources on the map that can be collected with the COLLECT command
//Example:
//creep.collect(2)

//The creep can move around with the move command
//Example:
//creep.move("UP")

//The creep can heal somebody with the heal command
//Example:
//creep.heal(5)

//The creep can attack somebody with the attack command
//Example:
//creep.heal(5)

//Loop this
void run(){
  //ACTIONS HERE  
  sleep(1000)
}
aalemayhu commented 6 years ago

The API should also be well documented with several examples. If you know any easy documentation systems that could fit, please suggest them here.

NyasakiAT commented 6 years ago

Should be possible to join a team an track the players in a team

aalemayhu commented 6 years ago

User should also be able to pick a colour for their snake.

Mobilpadde commented 6 years ago

831ced496b5adacea30bfbbdf914b86660356a14 should close this issue

aalemayhu commented 6 years ago

@Mobilpadde and @Nyasaki great work. Tested it and it seems to be working.