Skip to content

Repository files navigation

It Takes Four

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.

Game Rules

Objective:

The objective of the game is to form a line of four of your discs, either horizontally, vertically, or diagonally, before your opponent does.

How to Play:

  • 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.

Win Condition:

Be the first to form a line of four discs in a row—either horizontally, vertically, or diagonally.

Features

  • 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.

Technologies Used

  • 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.

Installation

To run the project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Marwaa703/FourGame.git
    cd FourGame
  2. Install dependencies:

    npm install
  3. Start the app with Expo:

    npx expo start
  4. Open the app on your mobile device or emulator using the Expo Go app.

Contributing

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.

Download

You can Download the Android APK version from here: It Takes Four

Demo

You can see a Demo for this App here: It Takes Two Demo

About

It Takes Four is an engaging and competitive two-player connection game where the goal is to be the first to form a horizontal, vertical, or diagonal line of four of your own discs. Players take turns dropping colored discs into a vertically suspended grid, with each disc falling into the lowest available space in the selected column.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages