Welcome to the Connect Four game! This project is a web-based implementation of the classic Connect Four game, developed using HTML, CSS, and JavaScript (Vue.js). The game allows two players to take turns dropping pieces into a grid, aiming to connect four of their pieces in a row either horizontally, vertically, or diagonally.
- Two-player gameplay (Red vs. Yellow).
- Interactive and responsive UI.
- Winning and draw detection.
- Option to start a new game.
- Visual indicators for the current player's turn.
- Keyboard navigation support.
You can try out the live demo of the game here.
To run the game locally, follow these steps:
-
Clone the repository:
git clone https://github.com/SmitParekh84/Connect-Four-Game.git cd connect-four -
Open the project in your preferred code editor:
-
Run the game: Open
index.htmlin your web browser.
- Open
index.htmlin your web browser. - The game board will be displayed, and the game will start with Red's turn.
- Click on a column to drop a piece.
- The turn switches to the other player after a piece is dropped.
- The game announces the winner or a draw when the game ends.
- Click the "New game" button to start a new game.
- Players take turns to drop their colored pieces into one of the columns.
- The piece will occupy the lowest available slot within the column.
- The objective is to connect four of your pieces in a row - vertically, horizontally, or diagonally.
- The game ends when a player connects four pieces or when the board is full, resulting in a draw.
├── assets
│ ├── css
│ │ └── style.css # Stylesheet for the game
│ ├── images
│ │ └── Logo.png # Game logo
│ └── scripts
│ └── script.js # JavaScript logic for the game
├── index.html # Main HTML file
└── README.md # Readme file
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for more details.
© Copyright by Smit Parekh ❤️
Feel free to reach out if you have any questions or feedback!