This is a little project to teach programming skills as well as basic AI. To run it just execute main.py with python.
Every time a trank becomes "idle" it will run the
think() function associated
with that brain to queue up more commands.
The tank then executes these, which can take a variable amount of time.
Tanks can also fire shots in the direction they are facing.
They must turn to aim.
Turning one facing takes half a second, turning twice takes one second.
The shots move at twice the speed of a tank.
- Crossing dirt will take twice as long as regular tiles.
- The tank will abort a move if it runs into a blocking tile or other tank.
- Shots can destroy blocking tiles such as trees or rocks.
- Driving into water will destroy the tank.
Making a Brain
Copy brains/wander.py to brains/yourname.py and add "yourname" it to config.py. For now it will only read the first two brains listed. There is a small guide that describes what this brain does and what is available for brains to use in wander.py.
- Add explosions and other animations.
- Make sound effects for actions.
- Add GUI elements like victory screen, etc.
- Python 2.7+ - does NOT run on Python 3.
AVBin - For playing music & sounds.
- Windows users should pull down http://code.google.com/p/avbin/downloads/detail?name=avbin-win32-5.zip.
- OSX users should use http://code.google.com/p/avbin/downloads/detail?name=avbin-darwin-x86-64-8.zip.
- After downloading the zip, unzip & run sudo install.sh.
$ sudo apt-get install libavbin-dev
$ python main.py brains/amanda.py brains/phil.py
The code is GPLv3, but the art/sound is not.