Tanklang Play free

A JavaScript programming game: you code the robot, it fights on its own

In Tanklang you write the "brain" of a tank in JavaScript and it battles on its own, in real time, against other players' robots. It is free, runs in the browser and needs no install.

Try the arena now (no sign-up)

Click buttons, change speed and shot power, and watch the code change instantly.

How it works

  1. Write the robot

    A code editor in the browser, with autocomplete. First-time coders start with the no-code builder and then tweak the generated code.

  2. It fights on its own

    Your robot enters duels, team battles and automatic battles against other players, even while you are away. Every battle becomes a replay.

  3. Improve and climb

    Watch the replay, adjust your strategy and climb the ELO ladder. The campaign has bosses only good code can beat.

A real robot in a few lines

This robot drives in a circle, sweeps its radar until it finds the enemy, locks its aim on it and fires. It is the same code as the test arena on the home page.

const SPEED = 5;   // 0 to 8
const TURN = 4;    // degrees per tick
const POWER = 2;   // shot power

let me;
const shortest = (a) => ((a % 360) + 540) % 360 - 180;

function run(snapshot) {
  me = snapshot.self;
  setSpeed(SPEED);
  turnBody(TURN);
  turnRadar(45);
}

function onScannedRobot(event) {
  const enemy = me.heading + event.bearing;
  turnRadar(shortest(enemy - me.radarHeading));
  turnGun(shortest(enemy - me.gunHeading));
  fire(POWER);
}

What you learn by playing

Who it is for

People learning to code

A concrete reason to write code: watching your own robot win.

Teachers, schools and robotics clubs

A logic or educational robotics class where students code and compete, with nothing to install.

Developers

Strategy, algorithms and optimization in plain JavaScript, with a ladder and tournaments.

Robocode fans

The same idea of programmed robot battles, now online, in the browser and in JavaScript.

Tanklang and Robocode

Robocode is the classic robot battle game programmed in Java. Tanklang is inspired by it, with differences: it runs right in the browser, robots are written in JavaScript, battles happen online against other people's robots, and there is an ELO ladder, a campaign with bosses and team battles. Tanklang is not affiliated with the Robocode project.

What is in the game

Frequently asked questions

Is Tanklang free?

Yes. Playing, building robots, battling, joining tournaments and climbing the ladder are free. There is an optional Premium Pass with cosmetics and convenience, and it never makes a robot stronger in battle.

Do I need to know how to code?

No. You can start with the no-code builder or the test arena on the home page and change the code little by little.

Which programming language does it use?

JavaScript, the language of the web. The code runs isolated on the server, with the same rules for everyone.

Is it like Robocode?

It is inspired by it: programmed robot tanks that fight on their own. The difference is that Tanklang is online, in the browser and in JavaScript, with a ladder, a campaign and team battles.

Can it be used in programming or robotics classes?

Yes. Students code in the browser with nothing to install and can compete in a tournament created by the teacher.

What is the minimum age?

13. Accounts for ages 13 to 15 need a parent or guardian's permission, and purchases by anyone under 18 are always paid by the guardian.

Does it work on phones?

Yes, in the browser on a phone, tablet or computer. For writing code comfortably, a computer is better.

Your first robot takes 1 minute

Try the arena now, no sign-up. If you like the robot you built, it becomes the first robot on your account.

Try the arena now (no sign-up)