Python Shell Batchfile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
networking
resources
screens
.gitignore
LICENSE.md
README.md
app.py
build_linux.sh
build_mac.sh
build_windows.bat
gui.py
objects.py
requirements.txt
run.py
screenshot.png
settings.py
utils.py

README.md

Connect Four

The Connect Four game, implemented in Python.

Features

  • All the Connect Four rules
  • State of the art graphics
  • Chips that made the player win are highlighted
  • Sound effects!
  • Musics!
  • Player's score
  • Two players, either:
    • On the same computer
    • (WIP) LAN game
    • (WIP) Online game

Prerequisites

Python 3. May eventually works with Python 2 (not tested).

Installation

Clone this repo, and then the usual pip install -r requirements.txt.

Usage

python run.py [--dev]

--dev enable WIP features (like network games).

Controls

  • ESC quits to the menu or close the game when already on the menu
  • and moves the chip respectively to the left and to the right
  • drops the chip in the selected column
  • starts a new game when one is finished

How it works

This game is built on top of PyGame. I obviously can't explain how it works here, so you'll have to jump yourself in the source code. Start with the entry point, run.py.

Beside the game itself, I use PyInstaller to generate the executables. It packs up all the game and its assets in a single executable file so players just have to run it with nothing to install. This task is performed by the build_* scripts to be run in the corresponding OS.

Network gaming is done by WebSockets using Autobahn. A master server (with the help of a REST API) is used to centralize all the online Connect Four games.

Credits

  • Board graphics by François Haffner (public domain)
  • Sound effects by Freesfx.co.uk (© Freesfx.co.uk)
  • Musics by SoundImage.org (Royalty-Free)
  • Font by Tobias Benjamin Köhler (freeware)
  • Thanks to the Swervin Mervin game's source code who helped me a lot to properly design the architecture of my game and understand the PyGame mechanics
  • Connect Four™ is a trademark of Milton Bradley / Hasbro. This project isn't supported nor endorsed by Milton Bradley / Hasbro

Gotcha

This is my very first game I ever crafted, and my very first projet using PyGame, so please be indulgent.

End words

If you have questions or problems, you can submit an issue.

You can also submit pull requests. It's open-source man!