|
| 1 | +# Robocode Tank Royale - Python Bot API |
| 2 | + |
| 3 | +<img src="https://github.com/robocode-dev/tank-royale/raw/master/gfx/Logo/Robocode-logo.svg" width="220" alt="Robocode logo"> |
| 4 | + |
| 5 | +**Build the best - destroy the rest!** |
| 6 | + |
| 7 | +The **Python Bot API** for [Robocode Tank Royale](https://robocode-dev.github.io/tank-royale/) - the next evolution of the classic Robocode programming game where you code virtual tanks to battle against each other in a virtual arena. |
| 8 | + |
| 9 | +## About Robocode Tank Royale |
| 10 | + |
| 11 | +Robocode is a programming game where the goal is to code a bot in the form of a virtual tank to compete against other bots in a virtual battle arena. The player is the programmer of a bot, who will have no direct influence on the game. Instead, you must write a program with the logic for the brain of the bot containing instructions about how it should behave during battles. |
| 12 | + |
| 13 | +**Tank Royale** is the next generation of Robocode that supports: |
| 14 | +- Network-based battles via WebSocket connections |
| 15 | +- Multiple programming languages and platforms |
| 16 | +- Modern architecture and improved performance |
| 17 | +- Real-time multiplayer battles |
| 18 | + |
| 19 | +## Installation |
| 20 | + |
| 21 | +Install the Python Bot API using pip: |
| 22 | + |
| 23 | +```shell |
| 24 | +pip install robocode-tank-royale |
| 25 | +``` |
| 26 | + |
| 27 | +### Requirements |
| 28 | +- **Python 3.10 or higher** |
| 29 | +- WebSocket support (automatically handled by dependencies) |
| 30 | + |
| 31 | +## Quick Start |
| 32 | + |
| 33 | +Check out the complete **MyFirstBot** example on GitHub: |
| 34 | + |
| 35 | +**📁 [MyFirstBot.py](https://github.com/robocode-dev/tank-royale/blob/master/sample-bots/python/MyFirstBot/MyFirstBot.py)** |
| 36 | + |
| 37 | +This sample bot demonstrates: |
| 38 | +- Basic movement (forward/backward) |
| 39 | +- Gun rotation and targeting |
| 40 | +- Event handling (scanned bot, hit by bullet) |
| 41 | +- Async/await programming pattern |
| 42 | + |
| 43 | +The bot moves in a seesaw motion, spins its gun to scan for enemies, and fires when it spots another bot. |
| 44 | + |
| 45 | +## Features |
| 46 | + |
| 47 | +The Python Bot API provides: |
| 48 | + |
| 49 | +- **Full Bot Control**: Move your tank, rotate gun and radar, fire bullets |
| 50 | +- **Event Handling**: Respond to hits, bot scanned, bullet impacts, and more |
| 51 | +- **Battle Information**: Access to battle state, opponent positions, and game rules |
| 52 | +- **Debugging Support**: Built-in debugging and logging capabilities |
| 53 | +- **Modern Python**: Type hints and modern Python features supported |
| 54 | + |
| 55 | +## Getting Started |
| 56 | + |
| 57 | +1. **Install the package**: `pip install robocode-tank-royale` |
| 58 | + |
| 59 | +2. **Download Robocode Tank Royale**: Get the game GUI and server from the [official releases](https://github.com/robocode-dev/tank-royale/releases) |
| 60 | + |
| 61 | +3. **Create your bot**: Download and study [MyFirstBot.py](https://github.com/robocode-dev/tank-royale/blob/master/sample-bots/python/MyFirstBot/MyFirstBot.py) or check the documentation |
| 62 | + |
| 63 | +4. **Run battles**: Start the GUI, add your bot, and watch the battles unfold! |
| 64 | + |
| 65 | +## Documentation & Resources |
| 66 | + |
| 67 | +- **📖 Official Documentation**: [robocode-dev.github.io/tank-royale](https://robocode-dev.github.io/tank-royale/) |
| 68 | +- **🚀 Getting Started Guide**: [Getting Started Tutorial](https://robocode-dev.github.io/tank-royale/tutorial/getting-started) |
| 69 | +- **🤖 My First Bot Tutorial**: [Create Your First Bot](https://robocode-dev.github.io/tank-royale/tutorial/my-first-bot.html) |
| 70 | +- **📚 API Reference**: [Python API Documentation](https://robocode-dev.github.io/tank-royale/api/apis.html) |
| 71 | +- **🤖 Sample Bots**: [Python Examples](https://github.com/robocode-dev/tank-royale/tree/master/sample-bots/python) |
| 72 | +- **💾 Source Code**: [GitHub Repository](https://github.com/robocode-dev/tank-royale/tree/main/bot-api/python) |
| 73 | + |
| 74 | +## Supported Platforms |
| 75 | + |
| 76 | +Robocode Tank Royale runs on: |
| 77 | +- **Windows** |
| 78 | +- **macOS** |
| 79 | +- **Linux** |
| 80 | + |
| 81 | +The Python Bot API works with **Python 3.10+** on all supported platforms. |
| 82 | + |
| 83 | +## Community & Support |
| 84 | + |
| 85 | +- **GitHub Issues**: [Report bugs and request features](https://github.com/robocode-dev/tank-royale/issues) |
| 86 | +- **Discussions**: [Community discussions and help](https://github.com/robocode-dev/tank-royale/discussions) |
| 87 | +- **Contributing**: Check out our [Contributing Guide](https://github.com/robocode-dev/tank-royale/blob/master/CONTRIBUTING.md) |
| 88 | + |
| 89 | +## Development Status |
| 90 | + |
| 91 | +🚧 **Work in Progress**: The Python Bot API is currently under active development. Features and APIs may change before the stable release. |
| 92 | + |
| 93 | +## License |
| 94 | + |
| 95 | +Licensed under the [Apache License 2.0](https://github.com/robocode-dev/tank-royale/blob/master/LICENSE) |
| 96 | + |
| 97 | +## Copyright |
| 98 | + |
| 99 | +Copyright © 2022 [Flemming N. Larsen](https://github.com/flemming-n-larsen) |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +**Ready to build the best tank and destroy the rest?** Start coding your bot today! 🚀🎯 |
0 commit comments