A downloadable module

See the author's notes for this project here.

See the GitHub repository for this project here.

See the online documentation for this project here.

Note that this downloadable archive contains only source code and documentation. You must have Python installed in order to run it.

This project is meant as a learning tool for intermediate-level Python students. It is a Python module that defines a combat game in which programmable turtle robots move around a battlefield firing missiles to destroy each other. A parent class defines a variety of basic attributes and methods for these turtle robots, and a local AI directory contains a variety of subclasses of this parent class which define different turtle AIs.

The player is meant to write their own turtle AI by extending the included parent class and overwriting a few key methods. Custom AI submodules (in the form of standalone .py files) can be dropped into the AI directory to import the player's AI into the game. Several example and template subclasses are included in this directory to get the player started, and both the included and the online documentation contain detailed guides for writing custom AIs. Python students might enjoy competing against each other to see whom can come up with the best AI, while Python instructors might consider running a class tournament to encourage students to learn more about object-oriented programming.

The game, itself, is arena combat game in which two AI-controlled turtle robots fight to the death. Each turtle begins on one side of an arena full of obstacles. Turtles are free to move around the arena, negotiate obstacles, take cover, and aim and fire short-range explosive missiles at each other as their AIs dictate. The object of the game is to destroy the enemy turtle before it destroys you. Because the game and all AIs are written entirely in Python, these AIs can be as simple or as complicated as the player wishes.

Download

Download
CombatTurtles.zip 52 kB

Install instructions

To play, download and extract CombatTurtles.zip. The game can be started by running the main driver script combatturtles.py and calling the combat_turtles() function, or by running the script from the command line (see documentation for command line arguments). Custom AIs can be included by adding them to the ai/ folder.

See the included Readme.txt (or the online documentation here) for a full guide.

Development log