This is a simple Tug of War game built using React Native. The game consists of two players competing against each other by tapping on their respective halves of the screen. The goal is to reduce the opponent's side to a height of 20 or less. The game features a flashing animation when a player taps, and a winner is declared when one side wins. The game can be reset to play again.
- Two-player gameplay (top vs. bottom).
- Flashing animation on tap.
- Dynamic color transitions for visual feedback.
- Reset button to restart the game.
Before running the app, ensure you have the following installed:
- Node.js (v14 or higher)
- npm or Yarn
- React Native CLI or Expo CLI
Clone this repository to your local machine using the following command:
git clone https://github.com/your-username/tug-of-war-game.git
cd tug-of-war-gameInstall the required dependencies using npm or Yarn:
npm install
# or
yarn installStart the development server and run the app on an emulator or physical device.
For React Native CLI:
npx react-native run-android
# or
npx react-native run-iosFor Expo CLI:
expo startThen scan the QR code with the Expo Go app on your mobile device.
The app uses the following dependencies:
-
react: Core library for building the UI.
-
react-native: Framework for building native apps using React.
-
react-native-reanimated (if applicable): For smooth animations.
-
The screen is divided into two halves: top and bottom.
-
Each player taps rapidly on their respective half to increase their side's height and decrease the opponent's.
-
The game ends when one side's height is reduced to 20 or less.
-
A winner is declared, and the game can be reset using the "Play Again" button.
