Code Monkey home page Code Monkey logo

bites-game's Introduction

Bites-game

Code written by John Baxter

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:

  1. Opening a terminal window and navigating to the repo.
  2. 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.

  1. Clone this repository to your own machine.
  2. Open a terminal window and navigate to the local version of the repo.
  3. Enter the command python3 controller.py.
  4. 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.

bites-game's People

Contributors

john-baxter avatar

Watchers

Ana Andres-Arroyo avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.