Skip to content

Connect Four is a two-player strategy game where players take turns dropping colored discs into a vertically suspended grid. The goal is to be the first to form a horizontal, vertical, or diagonal line of four of one's own discs.

Notifications You must be signed in to change notification settings

Krishnasingh020/connect_four

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

🎮 Connect Four – Python & Pygame

Connect Four is a classic 2-player connection game in which the players first choose a color and then take turns dropping colored discs into a 6×7 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.

🛠️ Built With

  • Python 🐍
  • Pygame 🎮

ScreenShot

Description

💡 Features

  • Interactive GUI using Pygame
  • Turn-based gameplay for two players
  • Win detection (horizontal, vertical, and both diagonals)
  • Board resets after a win
  • Visual and text-based feedback

▶️ How to Run

  1. Install Pygame:
    pip install pygame
    python connect_four.py

🕹️ How to Play

The game opens with a 7x6 grid.

Player 1 uses Red, Player 2 uses Yellow.

Click on the top of a column to drop your piece.

The first player to align four of their pieces horizontally, vertically, or diagonally wins.

✨ Future Improvements

Add AI opponent using Minimax algorithm

Add score tracking and game history

Add background music and sound effects

Export as a standalone executable

📄 License

This project is for educational purposes and personal use. Feel free to use and modify it!

🙋‍♂️ Author

Made with ❤️ by Krishna Singh.

About

Connect Four is a two-player strategy game where players take turns dropping colored discs into a vertically suspended grid. The goal is to be the first to form a horizontal, vertical, or diagonal line of four of one's own discs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages