<<<<<<< HEAD
A one-screen mobile game: bubbles rise from the bottom, you tap anywhere to shoot a vertical laser, and popped bubbles give points. The round lasts 120 s.
A React Native mobile game built with Expo CLI for CP4282 Programming for Mobile Devices.
Bubble Popper is a simple one-screen mobile game where:
- Bubbles rise from the bottom of the screen every 0.5 seconds
- Players tap anywhere to shoot a vertical red laser
- Lasers pop bubbles for points (+1 point per bubble)
- Game lasts for 120 seconds
- Final score is displayed with a "Play Again" option
- Bubble Spawner: Creates a circle every 0.5s at bottom with random x position
- Bubble Motion: Moves each bubble straight upward until it leaves the top
- Laser Shot: On any tap, draws a vertical red line from bottom that lasts 0.3s
- Hit Test: If laser crosses a bubble, removes bubble and adds +1 point
- Score Label: Shows "Score: N" in the top-left corner
- Countdown Timer: Starts at 120s, when it hits 0, freezes play and shows Game Over with final score and Play Again button
- Runtime: Expo CLI
- Language: Pure JavaScript (.js files)
- Framework: React Native
- Animation: Built-in Animated API
- Input: Built-in Pressable component
BubblePopper/
├── App.js # Main app component that registers GameScreen
├── GameScreen.js # Game logic & hooks
├── components/
│ ├── Bubble.js # Circle view component
│ └── Laser.js # Temporary vertical line component
├── package.json
└── README.md
- Make sure you have Node.js installed
- Install Expo CLI globally (if not already installed):
npm install -g @expo/cli
- Navigate to the project directory:
cd BubblePopper - Install dependencies:
npm install
npm run androidnpm run iosnpm run webnpm start- Tap "Start Game" to begin
- Bubbles will start spawning from the bottom and floating upward
- Tap anywhere on the screen to shoot a red laser vertically
- Try to hit as many bubbles as possible within 120 seconds
- Each bubble hit gives you +1 point
- When time runs out, your final score is displayed
- Tap "Play Again" to restart
- Tap anywhere: Shoot laser
- Start Game button: Begin new game
- Play Again button: Restart after game over
- Each bubble popped = +1 point
- Game duration = 120 seconds
- Goal: Get the highest score possible!
- Uses React hooks (useState, useEffect, useRef) for state management
- Implements game loops using setInterval for bubble spawning and animation
- Uses Pressable component for touch input handling
- Collision detection between laser and bubbles using distance calculation
- Responsive design that adapts to different screen sizes
✅ Individual project using React Native
✅ Pure JavaScript implementation (no TypeScript)
✅ All 6 required features implemented
✅ Runs on Android Emulator without crashes
✅ Clean, readable code structure
✅ Follows suggested file organization
Created for CP4282 Programming for Mobile Devices - Spring 2025
3d8765d (Initial commit: Set up Expo React Native project structure)