Skip to content
@code-game-project

CodeGame

Online, multiplayer, OpenSource, coding games with support for many languages.

CodeGame

What is CodeGame?

With CodeGame you can programmatically control a player in a wide variety of multiplayer games by writing a player controller in your favorite programming language.

CodeGame aims to make this process as easy as possible by standardizing the communication between game servers and clients.

We provde a set of tools and libraries which let you focus on writing the actual controller logic instead of having to worry about complex networking and communication.

Who is the target audience?

The CodeGame protocol is very flexible and allows the creation of games ranging from very simple ones like a number guessing game or tic-tac-toe to complex strategy games or third-person shooters.

Therefore, everyone who is comfortable with writing basic if-statements and is willing to learn (or at least memorize) some more complex syntax for their language of choice can write a player controller or game for CodeGame.

Advanced players can create complex AIs for Hover Race utilizing sophisticated neural networks and beginners can write a simple for-loop that tries every number sequentially in Number Guessing.

How does it work?

The protocol

CodeGame is an event driven protocol. After creating and joining a game over a standardized HTTP API all communication happens in JSON form over a WebSocket connection.

Game servers send event objects to clients to inform them of any changed state in the game.

Clients take that information to make decisions and send command objects to the server, telling it what the player should do.

Example

The Number Guessing game accepts a guess command from the client containing the number it guesses.

Depending on the number the server responds with either a too_low, a too_high or a correct event.

Tooling

The CodeGame CLI helps you to painlessly develop CodeGame applications. It makes setup very easy and provides a universal interface to launch and build your projects.

How to get started?

Take a look at the quick start guide. It teaches you the basics of CodeGame by walking you through the installation process and the creation of a simple bot for the Number Guessing game.

Browse through our collection of guides to learn about diverse topics like CodeGame Share or how to create your own game.

To gain a deeper understanding of how CodeGame works internally we recommend reading the technical specification.

List of games

To view a list of games created by us visit games.code-game.org. Of course you can create your own games or use ones created by other people.

Pinned Loading

  1. codegame-cli codegame-cli Public

    The official CodeGame CLI.

    Go 2

  2. go-client go-client Public

    The Go client library for CodeGame.

    Go

  3. javascript-client javascript-client Public

    This is the JavaScript Client for CodeGame. It works in Node.js and most Browsers.

    TypeScript 2

  4. csharp-client csharp-client Public

    The C# client library for CodeGame.

    C#

  5. go-server go-server Public

    The Go server library for CodeGame.

    Go

  6. hoverrace hoverrace Public

    Race against other hovercrafts from checkpoint to checkpoint.

    Go

Repositories

Showing 10 of 31 repositories
  • javascript-client Public

    This is the JavaScript Client for CodeGame. It works in Node.js and most Browsers.

    code-game-project/javascript-client’s past year of commit activity
    TypeScript 2 MIT 0 0 1 Updated Jun 18, 2024
  • go-server Public

    The Go server library for CodeGame.

    code-game-project/go-server’s past year of commit activity
    Go 0 MIT 0 0 0 Updated May 21, 2023
  • cli-utils Public

    Utility packages for developing codegame-cli and its modules

    code-game-project/cli-utils’s past year of commit activity
    Go 0 MIT 0 0 0 Updated May 5, 2023
  • codegame-cli Public

    The official CodeGame CLI.

    code-game-project/codegame-cli’s past year of commit activity
    Go 2 GPL-3.0 0 0 0 Updated May 1, 2023
  • codegame-cli-go Public

    The Go module for codegame-cli.

    code-game-project/codegame-cli-go’s past year of commit activity
    Go 0 GPL-3.0 0 0 0 Updated Apr 23, 2023
  • cli-module Public

    A Go package for developing CodeGame CLI language modules.

    code-game-project/cli-module’s past year of commit activity
    Go 0 MIT 0 0 0 Updated Apr 21, 2023
  • go-client Public

    The Go client library for CodeGame.

    code-game-project/go-client’s past year of commit activity
    Go 0 MIT 0 0 0 Updated Apr 19, 2023
  • game-frontend-number-guessing Public Forked from code-game-project/game-frontend-template-svelte

    Number-Guessing's frontend based on game-frontend-template-svelte.

    code-game-project/game-frontend-number-guessing’s past year of commit activity
    Svelte 0 AGPL-3.0 2 0 0 Updated Apr 14, 2023
  • website Public

    The code-game.org website.

    code-game-project/website’s past year of commit activity
    JavaScript 0 MIT 0 0 0 Updated Apr 14, 2023
  • javascript-server Public

    This is the JavaScript (and TypeScript) server library for CodeGame.

    code-game-project/javascript-server’s past year of commit activity
    TypeScript 0 MIT 0 0 0 Updated Apr 14, 2023

Top languages

Loading…

Most used topics

Loading…