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

  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

Top languages

Loading…

Most used topics

Loading…