Quickstart Tutorial
How It Works
Botomy uses a client-server architecture:
- The game (client) sends level data to your bot server via POST requests
- Your server processes the data and returns a list of moves
- The game executes those moves for your character
Getting Started
-
Download a starter project:
-
Start your server (follow the repo's README instructions). It should be running on port 3000.
-
In Botomy:
- Press RUN
- You should see your character say "Hello Botomy!"
Making Your First Bot
Let's modify the default code to make your character move and attack:
Basic Movement
In your server, return a position for your player to move towards:
API RESPONSE
[
{
"move_to": {
"x": <x_coord>,
"y": <y_coord>,
}
}
]
// TypeScript example modifying src/play.ts
function play(levelData: LevelData) {
const moves = [];
// Move to coordinate (100, 100)
moves.push({ move_to: { x: 100, y: 100 } });
return moves;
}
# Python example modifying play.py
def play(level_data: dict) -> list:
moves = []
# Move to coordinate (100, 100)
moves.append({"move_to": {"x": 100, "y": 100}})
return moves
You will see your character moving to the top left.
Every object in the game has a position making it easy to move towards whatever you like.
The coordinate system is "raster coordinate system" where the origin is at the top left and the y-axis increases downwards.
Combat
Return the attack move
API RESPONSE
[
{
"move_to": {
"x": <x_coord>,
"y": <y_coord>,
}
},
"attack"
]
// TypeScript example modifying src/play.ts
function play(levelData: LevelData) {
const moves = [];
// Move to coordinate (100, 100)
moves.push({ move_to: { x: 100, y: 100 } });
// Attack
moves.push("attack");
return moves;
}
# Python example modifying play.py
def play(level_data: dict) -> list:
moves = []
# Move to coordinate (100, 100)
moves.append({"move_to": {"x": 100, "y": 100}})
# Attack
moves.append("attack")
return moves
You will see your character attacking while moving.
Try other combat mechanics like "shield", and "dash". See more here Basic Gameplay
Your API is called multiple times per frame. This means your bot can make multiple moves per frame. The game will execute them in real time.
Debugging
Next Steps
- Review Basic Gameplay for all available moves
- Join our Discord for help and to share your bots!