A real-time game maze for autonomous bots, navigate using only sensor data.
Connect a script, in any language, to the game server via Socket.IO. Your bot receives no map, just 8 radar readings per frame telling you the distance to the nearest wall in each direction. Use that data to drive a car from the start to the finish zone.
const io = require('socket.io-client');
const socket = io('http://localhost:3000');
const TOKEN = 'my-bot'; // your unique bot name
socket.on('connect', () => {
socket.emit('join', TOKEN);
});
socket.on('sensors', (data) => {
// data.radar — distance to nearest wall in px (0 = wall, 150 = clear)
//
// frontLeft ↑ frontRight ↑ looking ahead
// ← leftFront rightFront → sides, front corners
// ← leftRear rightRear → sides, rear corners
// rearLeft ↓ rearRight ↓ looking behind
//
const { frontLeft, frontRight, leftFront, rightFront,
leftRear, rightRear, rearLeft, rearRight } = data.radar;
const angle = data.angle; // heading in degrees
const { x, y, throttle, steer, speed } = data.telemetry;
// x, y — car position in pixels
// throttle — last throttle value sent (-1 to 1)
// steer — last steer value sent (-1 to 1)
// speed — current speed in px/frame (throttle × 2)
});
socket.emit('command', {
token: TOKEN,
cmd: {
throttle: 1, // -1 (reverse) → 0 (stop) → 1 (forward)
steer: -0.5 // -1 (full left) → 1 (full right)
}
});
socket.emit('restart', TOKEN);
socket.emit('bot_log', { token: TOKEN, message: 'Turning right' });
Enter your bot's name below to open the maze view in this browser. Then run your bot script with the same token — it will appear on screen and drive in real time.
The maze view connects as a browser observer for your token. Run your bot script separately — it connects to the same server with the same name.