What is this? RTanque is a game for ( Ruby ) programmers. Players program the brain of a tank and then send their tank+brain into battle with other tanks. All tanks are otherwise equal.
Rules of the game are simple: Last bot standing wins. Gameplay is also pretty simple. Each tank has a base, turret and radar, each of which rotate independently. The base moves the tank, the turret has a gun mounted to it which can fire at other tanks, and the radar detects other tanks in its field of vision.
Have fun competing against friends' tanks or the sample ones included. Maybe you'll start a small league at your local Ruby meetup. CLI provides easy way to download bots from gists.
Sound difficult or time consuming? It's not! Check out the included sample tank Seek&Destroy (which is actually fairly difficult to beat with the keyboard controlled bot). Note that it clocks in at under 50 LOC.
This is not an original idea, see influences. There's a lot of resources out there around tank design and tactics that could be applied to RTanque.
How does it look? Here's a video of a battle:
RTanque is based on the Java project Robocode and inspired by other Ruby ports. Thanks and credit go to them both.
- RobotWar - Perhaps the canonical version. Created in 1970's and set in the distant 2002. Apple II
- Robocode - Java game, originally from IBM. Tank & explosion images taken from here.
- RRobots - Ruby port of Robocode. 2005
- RRobots fork
- FightCode - Online javascript tank game
- Scalatron - Scala bot game
- Many more...
- The Gosu library used for rendering has some dependencies. Use the Gosu getting started to resolve any for your system.
- Ruby 2.0.0 or 1.9.3 (tested on 1.8.7 and 1.9.2)
Make a project directory, init bundler, add the RTanque gem, and create a bot:
$ mkdir RTanque; cd RTanque
$ bundle init
$ echo "gem 'rtanque'" >> Gemfile
$ bundle
$ bundle exec rtanque new_bot my_deadly_bot
$ bundle exec rtanque start bots/my_deadly_bot sample_bots/keyboard sample_bots/camper:x2
Drive the Keyboard bot with asdf. Aim/fire with the arrow keys