A fun and interactive number guessing game built with React Native and Expo. Challenge your phone to guess the number you're thinking of!
This is a reverse number guessing game where the phone attempts to guess a number that YOU are thinking of. You provide hints (higher or lower) to guide the phone toward the correct answer. The game tracks how many rounds it takes for the phone to guess your number.
From left to right: Start Screen, Guessing Screen, Game Over Screen
- ๐ฏ Interactive number guessing gameplay
- ๐ Round tracking and game statistics
- ๐จ Beautiful gradient UI with custom styling
- ๐ผ๏ธ Background image with opacity effects
- ๐ฑ Responsive design for different screen sizes
- ๐ค Custom fonts (Open Sans)
- โก Optimized splash screen loading
- ๐ญ Platform-specific components (iOS/Android)
- ๐ Guess history log
- ๐ Restart game functionality
- React Native - Mobile app framework
- Expo SDK 49 - Development platform
- React 18.2 - UI library
- Expo Linear Gradient - Gradient backgrounds
- Expo Font - Custom font loading
- Expo Splash Screen - App loading screen
- Expo Status Bar - Status bar styling
- Ionicons - Icon library
react-native-numbers-game/
โโโ App.js # Main app component with navigation logic
โโโ screens/
โ โโโ StartGameScreen.js # Initial screen for number input
โ โโโ GameScreen.js # Main game screen with guessing logic
โ โโโ GameOverScreen.js # Victory screen with statistics
โโโ components/
โ โโโ game/
โ โ โโโ GuessLogItem.js # Individual guess history item
โ โ โโโ NumberContainer.js # Display container for numbers
โ โโโ ui/
โ โโโ Card.js # Reusable card container
โ โโโ InstructionText.js # Styled instruction text
โ โโโ PrimaryButton.js # Custom button component
โ โโโ Title.android.js # Android-specific title
โ โโโ Title.ios.js # iOS-specific title
โโโ constants/
โ โโโ colors.android.js # Android color theme
โ โโโ colors.ios.js # iOS color theme
โโโ assets/
โ โโโ fonts/
โ โ โโโ OpenSans-Regular.ttf
โ โ โโโ OpenSans-Bold.ttf
โ โโโ images/
โ โโโ background.png # Background image
โ โโโ success.png # Victory image
โโโ package.json
- Node.js (v14 or higher)
- npm or yarn
- Expo CLI
- iOS Simulator (for macOS) or Android Emulator
- Clone the repository:
git clone <repository-url>
cd react-native-numbers-game- Install dependencies:
npm install
# or
yarn install- Start the development server:
npm start
# or
yarn start- Run on your preferred platform:
# iOS
npm run ios
# Android
npm run android
# Web (limited functionality)
npm run web- Start Screen: Enter a number between 1 and 99 that you're thinking of
- Game Screen: The phone will make its first guess
- Tap the โ (Lower) button if your number is lower than the guess
- Tap the โ (Higher) button if your number is higher than the guess
- Game Over Screen: Once the phone guesses correctly, see how many rounds it took!
- Restart: Tap "Start New Game" to play again
- Choose a number between 1 and 99
- You must be honest with your hints!
- The game detects if you provide contradictory hints
- Each guess is logged in the guess history
- StartGameScreen: Number input with validation and keyboard handling
- GameScreen: Core game logic with binary search algorithm
- GameOverScreen: Victory celebration with round statistics
- Card: Elevated container with shadow and rounded corners
- PrimaryButton: Styled pressable button with ripple effect
- Title: Platform-specific title component
- InstructionText: Consistent text styling
- NumberContainer: Highlighted number display
- NumberContainer: Displays the current guess prominently
- GuessLogItem: Shows individual guesses in the history
- Linear gradient background (primary to accent colors)
- Semi-transparent background image
- Platform-specific color schemes
- Responsive layouts using
useWindowDimensions - Custom fonts with fallback support
- Shadow effects and elevation
The app includes platform-specific implementations:
- Colors: Different color schemes for iOS and Android
- Title Component: Platform-optimized text styling
- Status Bar: Light content style
Fonts are loaded using expo-font:
- Open Sans Regular
- Open Sans Bold
The app uses expo-splash-screen for optimized loading:
- Prevents auto-hide during font loading
- Smoothly transitions to the app when ready
- Fonts not loading: Clear cache with
expo start --clear - Module errors: Delete
node_modulesand reinstall - Metro bundler issues: Reset with
watchman watch-del-all
# Clear Expo cache
npx expo start --clear
# Clear watchman
watchman watch-del-all
# Reinstall dependencies
rm -rf node_modules && npm install{
"expo": "~49.0.8",
"expo-font": "~11.4.0",
"expo-linear-gradient": "~12.3.0",
"expo-splash-screen": "^0.20.5",
"expo-status-bar": "~1.6.0",
"react": "18.2.0",
"react-native": "0.72.4"
}Contributions are welcome! Feel free to:
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is open source and available for educational purposes.
- Built with Expo and React Native
- Uses OpenSans font family
- Inspired by classic number guessing games
Made with โค๏ธ using React Native & Expo


