Skip to content

z1skgr/Solitaire.py

Repository files navigation

Solitaire Game

The famous solitaire game using python libraries for graphical environment

Table of contents

General Information

The project is an equivalent realization of the well-known game of Klondlike Solitaire using cross-platform set of Python modules for computer graphics and sound libraries. The goal is to turn the entire deck into stacks and if this is achieved, the Solitaire game is won. The implementation is based on 3 main axes:

  1. Menu Scene
  2. Other scenes (Win/Lose/Τransitional)
  3. Game/Play environment

Features

  • Graphical design of components
  • Introductory/final scenes
  • Multimedia effects
  • Hint buttons

Prerequisites

  1. Install python1 environment. The instalation is easy either on Windows or Linux
  2. Install pygame2 modules
  3. Install Python IDE
    • This implementation is made in pyCharm

Install Python (Windows)

Install Python (Linux)

  1. Update repositories lists and supporting softwares
$ sudo apt update
$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt update
  1. Install main package
$ sudo apt install pythonXXX

where XXX version installed1

  1. Verify install completion

$ python --version

Install pygame (Windows)

  1. On any windows shell
python --version
pip install pygame
  1. Check the PyGame is working
import pygame

Install pygame (Linux)

  1. On terminal, first make sure you are using latest version of python3 with

$ python3 –version,

then

$ sudo apt-get install python3-pygame
  1. Check PyGame is working with python
python 3
pygame 1.9.6

How to run

Linux

  1. Open the terminal and go to home directory cd ~
  2. Navigate the directory of the project
  3. Run Solitaire.py

PyCharm

  1. Insert folder in PyCharm workshop
  2. File->Settings->Project->Project Interpreter
  3. Tap + and search PyGame
  4. Install packages
  5. Run .py

Setup

12

Acknowledgements

  • This project was created for the requirements of the lesson Autonomous Agents
  • The implementation was influenced by Raspigame for creating basic games.

Footnotes

  1. Our version was Python3.8 2

  2. PyGame is only supported python 3.7.7 or higher version

  3. Verify you are using pip