Skip to content

Oripy/foxintheforest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foxy

About The Project

This is an implementation of The Fox in the Forest, a trick-taking game for two players designed by Joshua Buergel.

I started building this because I wanted to toy around with building an Artificial Intelligence for a game, and because this is one of my favorite game.

I also used this project to learn about using python for web servers, using Flask.

Built With

Flask Extensions used

Getting Started

Installing should be quite straightforward for someone used to Flask.

Prerequisites

Create a new directory and clone the repo in it

mkdir foxy
cd foxy
git clone https://github.com/Oripy/foxintheforest.git

Create a new venv and activate it (to not pollute your python installation)

python -m venv .venv/
source .venv/bin/activate # Line to enter before any commands below

Install all required packages

python -m pip install -r requirements/prod.txt

Config file should look like this in instance/config.py

DEBUG = False
SECRET_KEY = "your secret key"

SQLALCHEMY_DATABASE_URI = "sqlite:///database.db" # path to you Database
SQLALCHEMY_TRACK_MODIFICATIONS = False

SESSION_COOKIE_SAMESITE = "Strict"

LANGUAGES = ['en', 'fr']

Running the program

Run the Redis server and start a worker with rq worker. Then use python run.py.

Development

Translation

Adding a new language ($LANG)

pybabel extract -F babel.cfg -k _l -o messages.pot .
pybabel init -i messages.pot -d app/translations -l $LANG

Updating all languages (when new lines of text to translate have been added)

pybabel extract -F babel.cfg -k _l -o messages.pot .
pybabel update -i messages.pot -d foxy/translations

Compile the translation files (when the tranlation files have been updated, or after a new installation)

pybabel compile -d foxy/translations

Database

Migrate the database

export FLASK_APP=run.py
flask db upgrade

Update the migration files (after a change in db structure)

flask db migrate -m "Migration message."

License

This software is distributed under the GPLv3.

About

Fox in the forest multiplayer platform with AI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published