davidkhach / ConnectFour

ConnectFour Game in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConnectFour game built in Python using the Pygame Library. Users are able to play against another player or against an AI. To drop a disk in a column, players can click anywhere within the column.

What is Connect Four?

Connect Four is a two-player connection game in which the players first choose a color and then take turns dropping one colored disc from the top into a seven-column, six-row vertically suspended grid. The pieces fall straight down, occupying the lowest available space within the column. The objective of the game is to be the first to form a horizontal, vertical, or diagonal line of four of one's own discs.

How to run and play?

To play the game, run view.py and follow the directions on the various screens (Must have Pygame installed).

Alt Text

(This gif shows human vs AI gameplay)

Current Features:

  • Easy to use GUI, players simply have to click anywhere within a column to drop a disk.
  • Players can play against another human or against an AI.
  • Current implemented difficulties for AIs are easy and medium.
  • Players choose what disk color they want to play as and they will always go first.
  • Users can create their own custom AIs using the customai.py file, further instructions are found in this file.
  • Right column displays which player's turn it currently is.
  • Once a player wins, message is displayed on bottom of GUI.

Future plan:

  • Allowing users to play against different difficulties of AI ranging from easy to hard (In Progress)
  • Allowing users to easily pick which difficulty AI they want to play against (In Progress)
  • Optimizing code to run more efficiently for determining whether there is a win or not (Not Completed)

About

ConnectFour Game in Python


Languages

Language:Python 100.0%