Scope / Motivation / Tech / Features / Code example / Tests / How to use / Future development / Credits
^Scope
This project aims to create a playable clone of the existing tabletop game 'Bites'.
^Motivation
The motivation to create this project was for me to improve my general understanding of the principles of Test-driven Development (TDD) and Object-oriented Programming (OOP) while also learning the basics of a new language and working on a project that is fun, engaging and more interesting than mindlessly following one of the many tutorials available on YouTube.
^Tech used
The project is written in Python 3
In the current state the whole project is using the Python standard library with no additional packages.
^Features
The project currently has the following features:
- The game is playable using a simple text-based interface in the Command Line
- 2 to 5 players can play at a time
- Standard food tokens, wine and chocolate used for the trail
- Standard ant colours used
- Players can collect food from the anthill
- Multiple options for anthill filling. The players may choose one or have the game randomly select one for them.
- Top-down
- Bottom-up
- Specific order: 4, 2, 0, 3 then 1
- User's choice (Not featured in the original game)
- Multiple options for wine-scoring rule. The players may choose one or have the game randomly select one for them
- "Collector"
- "Oenophile"
- Multiple options for special chocolate actions. The players may choose one or have the game randomly select one for them
- "Turbo"
- "Doubler"
Extra information about what each rule card refers to is available in this document.
^Code example
The following example shows the method within the
Player class
which is used after the choice of which ant to move has been made; and is responsible for defining at what position the ant's move will be completed.
NB The actual method in
player.py
file contains internal documentation whach has been ommited from this example for clarity.
def move_ant_along_trail(self, trail, ant_positions, ant):
if ant_positions[ant] is None:
ant_positions[ant] = 0
else:
ant_positions[ant] += 1
if trail[ant_positions[ant]] == K_COLOUR_V_FOOD_DICT[ant]:
return ant_positions
else:
while trail[ant_positions[ant]] != K_COLOUR_V_FOOD_DICT[ant]:
ant_positions[ant] += 1
return ant_positions^Tests
The whole project has been created using TDD. The tests are written using Python3's built-in testing framework:
unittest
These can be run by:
- Opening a terminal window and navigating to the repo.
- Enter the command
python3 -m unittest discover --pattern=*_test.py.
^How to use
If you want to try out this game app, the following steps are required.
(Instructions are specific to using a MacOS, other interfaces may require different/analogous steps.)
You will need to have Python 3.8 installed.
- Clone this repository to your own machine.
- Open a terminal window and navigate to the local version of the repo.
- Enter the command
python3 controller.py. - Follow the on-screen instructions to begin/continue playing.
Use of the app will require an understanding of how to play the game. An overview and downloadable instruction manaual are available here
^Future development
Information regarding which features will be added in the future can be found here.
^Credits
Original game by Brigitte Ditt & Wolfgang Ditt.
Original artwork by Anca Gavril & Filip Gavril.
Software architecture and Technical leadership by Ana Andrés.