- Dynamic resize of cards, spacing, and offset (works for any size screen!)
- All cards loaded from a sprite sheet for increased speed (generated using spright)
- Option for custom number of cards to draw (the default is 3 but you can change it to whatever you want)
- Optional debug output
- Web support using pygbag
I started this project as soon as I learned about what a python class was.
Also, I don't remember how I got the card assets. some I made myself (by coloring over others)
Also also (last one), This was originally a school project :p
Get the executable from the release page to run it!
python
pygame
pygbag (optional for building web version)
docker (optional for building web version)
git clone https://github.com/DeadFoxx1/python_solitaire
cd python_solitaire
python -m venv .venvmacOS/Linux:
source .venv/bin/activateWindows:
.\.venv\Scripts\activatepip install -r requirements.txtNormal (no debug and draw 3):
python main.py#see -h for help
python main.py -husage: main.py [-h] [-d DEBUG] [-c CARDSTODRAW]
options:
-h, --help show this help message and exit
-d, --debug DEBUG enables debug output
-c, --cardstodraw CARDSTODRAW
number of cards to draw at a time (must be less then 24)
#easy mode
python main.py -c=1
#debug mode
python main.py -d=True
#you can use both args at the same time
python main.py -d=True -c=1Run for debug output:
python main.py -d=TrueEach card object _str_() is shown like this:
#5 of clubs that is face down:
5CFalseFace cards are still their number value:
#king of clubs facing up:
13CTrueFoundations and the very top of the columns are also card objects:
#all tops of the top columns are:
140True
#the foundations (specific to their suit):
0HTrue Other moves:
#valid move:
move 1STrue to 0STrue
#invalid move:
invalid move (3CTrue to 13HTrue)
#a card drawing:
draw(Currently dosen't support the use of the extra options)
pip install pygbagThere's a weird awaiting input screen so use --umn-block 0 to remove it
pygbag --ume_block 0 main.pyFind built files in /build
Test server runs on localhost:8000
In the root of the project directory
docker build -t solitaire .uses port 80 by default
docker run -p 80:80 solitaireThis game is released under the GNU GPLv3. It comes with absolutely no warranty. Please see LICENSE for license details.
