A local multiplayer 2D shooting game built with Next.js, React, and JavaScript.
- Two-player local multiplayer gameplay
- Smooth 60 FPS performance
- Health system with respawn mechanics
- Score tracking
- Pause functionality
- Retro gaming aesthetic
- Movement: WASD keys
- Shoot: Q key
- Starting Position: Left side
- Movement: Arrow keys (↑↓←→)
- Shoot: Spacebar
- Starting Position: Right side
- First player to score 10 points wins
- Players respawn after 3 seconds when eliminated
- Press ESC to pause during gameplay
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser
npm run build
npm start- ESC: Pause/Resume game
- Click Start Button: Begin new game
- Click Play Again: Restart after game over
- Built with Next.js 14 and React 18
- Uses requestAnimationFrame for smooth game loop
- CSS Modules for component-specific styling
- Frame-independent movement with delta time
- Efficient collision detection
- Component-based architecture for maintainability
- Limited bullet count on screen
- Efficient collision detection
- Clean event listener management
- Optimized rendering with React state management