Skip to content

Welcome to our two-player board game which is a computerized version of the conventional 'Connect4' or 'Captain's Mistress' game. The objective of this game is to be the first one to form a horizontal, vertical, or diagonal line of four of one's own chosen color (Red/Yellow). To know the rules, visit the link in the README and do give it a try!

Notifications You must be signed in to change notification settings

DevanshBansal1604/Connect4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Connect4

This is a computer game based on the 2-Player Connection Board Game 'Connect4', created using Python, Pygame and Pyautogui.

How to install and Run

Firstly setup a Virtual Environment by following the below steps:

  1. Open Windows Powershell with Run as Administrator, and enter command Set-ExecutionPolicy RemoteSigned.
  2. Then install virtualenv, by using command pip install virtualenv.
  3. Go to the folder, where you want to create the folder for your website. (Let it be named as 'VirtualEnv' (You can choose any name!)).
  4. Open Windows Powershell in that folder and run command virtualenv <folder_name> (Let <folder_name> be 'venv_folder').
  5. Go inside the new folder created (venv_folder) by running command cd <folder_name>.
  6. Then run command ./Scripts/activate. This will allow you to enter a functional virtual environment.
  7. Then download the zip file of the code, and extract the zip inside this folder (<folder_name>, here 'venv_folder').

Then run the below commands:

pip install -r requirements.txt

How to use

  1. After you run the above mentioned commands, run the main.py file.
  2. A home-page window will open on the screen, where you can enter the names of Players (by default, ther are Player 1 (red color) and PLayer 2 (yellow color)).
  3. Once you enter the corresponding names (not mandatory to change the default names), you are all set to play the game.
  4. You can start the game by clicking on the PLAY button.
  5. Now you will be presented with the main game-play region, a screen representing the 6x7 board of acutal board-game.
  6. Both the players can move as per the rules of the game as mentioned here: https://www.gamesver.com/the-rules-of-connect-4-according-to-m-bradley-hasbro/ .
  7. Now enjoy the game!

Libraries Used

  • pygame == 2.1.2
  • numpy == 1.22.3
  • pyautogui == 0.9.53
  • Python==3.9.0

Screen Shots

Home Page

Home Page

Names Entered

Names Entered

Game Board

Game Board

Winning Situation

Winning Situation

About

Welcome to our two-player board game which is a computerized version of the conventional 'Connect4' or 'Captain's Mistress' game. The objective of this game is to be the first one to form a horizontal, vertical, or diagonal line of four of one's own chosen color (Red/Yellow). To know the rules, visit the link in the README and do give it a try!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages