Game Link: https://www.codingame.com/contribute/view/7845e540d4efbbe4d9f4b68686460bb53424
- Getting Started with multiplayer game: https://www.codingame.com/playgrounds/25775/codingame-sdk-documentation/create-a-multiplayer-game
- javadoc: https://codingame.github.io/codingame-game-engine/
- Front-end Assets: https://github.com/CodinGame/codingame-sdk-assets
- Pacman Game: https://www.codingame.com/ide/puzzle/spring-challenge-2020
- Pacman Game GitHub: https://github.com/CodinGame/SpringChallenge2020
Line 1: two integers height
and width
- the size of the maze.
Next height
lines: a string of width
characters each representing one cell of a row: '.'
is an empty cell and '#'
is a wall.
Next line: my_flag_base_x
& my_flag_base_y
- player's flag-base position
Next line: opponent_flag_base_x
& opponent_flag_base_y
- opponent's flag-base position
Input for each game turn:
Line 1: my_score
& opponent_score
- player's and opponent's current score
Line 2: my_flag_pos_x
, my_flag_pos_y
& my_flag_captured
- player's flag position and whether it is currently being carried by opponet's minion (1 if captured, 0 otherwise)
Line 3: opponent_flag_pos_x
, opponent_flag_pos_y
& opponent_flag_captured
- opponent's flag position and whether it is currently being carried by player's minion (1 if captured, 0 otherwise)
Line 4: my_alive_minion_cnt
- number of player's alive minions
Next my_alive_minion_cnt
lines: id
pos_x
pos_y
health
- player's minion's id, position & health
Next Line: visible_minion_cnt
- number of opponent's visible minions
Next visible_minion_cnt
lines: id
pos_x
pos_y
health
- opponent's minion's id, position & health
-
Referee.init()
: All the backend and frontend based initializations are done here.maze.init()
: The maze is generatedgame.init()
: All the minions, flag and flag base along with their positions are generatedview.init()
: The initial frontend-view is generated like drawing the background, maze and the initial view of minions and flagsthis.sendInitialInfo()
: Send all the players global info about the game before entering the gameloop
-
Referr.gameTurn(int turn)
: Called on each game loop.turn
variable is not used as our game is not turn based like tic-tac-toe.game.resetTurnData()
: Resets data on each turn.sendGameStateToPlayers()
: Send each player current game state. (see player's i/o) and executes player's code.handlePlayerCommands()
: Parses player's output and sets the intended action to the corresponding minion.view.resetData()
: reset any view-based datagame.updateGameState()
: Updates game state: changes minions' movement, flag's position and prints game summaryview.updateFrame()
: changes minions' and flags' position in the front-endgame.endGame()
: adds winner's name to game-summarygameManager.endGame()
: ends the game and stops further i/o and frame update.
- CommandParser: Parses Player's commands
- Config: Contains game parameters
- Coord: Maze Co-ordinate class
- Flag
- FlagBase
- Game: Class for performing different game operations
- Maze
- Minion
- Player
- RandomUtil: Utility class for generating random numbers
- Referee: Handles the game (Mediator class)
- action: contains different types of minion actions
- exception
- grid: [ Copied from pacman game ]
- view: contains Front-end stuffs