It Takes Four is an engaging two-player connection game where the goal is to form a horizontal, vertical, or diagonal line of four discs before your opponent does. In single-player mode, you can challenge an AI opponent powered by the Minimax algorithm, which analyzes the game board and makes strategic decisions to either block your moves or secure a win.
Built with React Native, Expo, JavaScript, and CSS, It Takes Four offers a responsive and enjoyable experience on both Android and iOS devices.
The objective of the game is to form a line of four of your discs, either horizontally, vertically, or diagonally, before your opponent does.
- Two-Player Mode: Two players take turns dropping colored discs into a vertically suspended grid.
- Single-Player Mode (Computer vs Player): In single-player mode, you play as Red discs, and the computer plays as Yellow discs. The computer AI, powered by the Minimax algorithm, makes strategic moves to either block your winning moves or set up its own win.
- Players take turns tapping on the column where they want to drop their disc.
- The disc will fall to the next available space within the selected column.
Be the first to form a line of four discs in a row—either horizontally, vertically, or diagonally.
- Two-player mode: Play with a friend on the same device.
- Single-player mode: Compete against an AI opponent with intelligent moves powered by the Minimax algorithm.
- Responsive design: Smooth gameplay on both Android and iOS devices.
- Classic Connect Four rules: Form a line of four discs to win, using strategic moves.
- User-friendly interface: Easy-to-navigate controls with a tap to drop discs into columns.
- React Native: For building a cross-platform mobile app.
- Expo: To streamline development and testing.
- JavaScript: For the game logic and functionality.
- CSS: For styling the game layout.
To run the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/Marwaa703/FourGame.git cd FourGame -
Install dependencies:
npm install
-
Start the app with Expo:
npx expo start
-
Open the app on your mobile device or emulator using the Expo Go app.
If you'd like to contribute to this project, feel free to fork the repository and create a pull request. For any issues or suggestions, open an issue in the repository.
You can Download the Android APK version from here: It Takes Four
You can see a Demo for this App here: It Takes Two Demo