A showcasing modern web game development using various technologies including React Three Fiber, HTML5 Canvas, and traditional DOM manipulation. Built with Vite for optimal performance and featuring a comprehensive game collection.
-
๐ฏ Cube Adventure (Three.js/WebGL)
- Interactive 3D cube clicking game
- Hardware-accelerated graphics with Three.js
- Dynamic lighting and camera controls
-
โจ Particle Storm (HTML5 Canvas)
- 2D particle physics simulation
- Mouse interaction with colorful particle effects
- Real-time canvas rendering
-
๐ง Memory Match (Vanilla JavaScript)
- Classic card matching game
- CSS3 animations and transitions
- Pure JavaScript DOM manipulation
-
๐ฐ Tower Defense (jQuery)
- Strategic tower placement game
- Enemy waves and projectile physics
- jQuery-powered interactions
-
๐ Cosmic Defender (React Three Fiber) โญ NEW
- 3D space shooter in zero gravity
- Physics-based spaceship controls
- Asteroid destruction with explosion effects
- Uses TwoSlotLayout with vertical configuration
- โก Vite - Lightning-fast build tool and development server
- โ๏ธ React 18 - Latest React with Hooks and modern patterns
- ๐ฆ React Router - Client-side routing with nested layouts
- ๐จ Material-UI - Modern component library with dark theme
- ๐ฑ Responsive Design - Mobile-first approach across all games
- ๐ฎ Multiple Game Technologies - Showcase of web game development approaches
- ๐ฏ Game Layout System - Specialized layouts for immersive gaming
- ๐ 3D Graphics - WebGL and React Three Fiber integration
src/
โโโ components/
โ โโโ layouts/
โ โ โโโ Layout.jsx # Main app layout
โ โ โโโ GameLayout.jsx # Full-screen game layout
โ โ โโโ TwoSlotLayout.jsx # Flexible dual-slot layout
โ โ โโโ TwoSlotDemo.jsx # Layout demonstration
โ โโโ games/
โ โ โโโ CubeAdventure.jsx # Three.js 3D game
โ โ โโโ ParticleStorm.jsx # HTML5 Canvas game
โ โ โโโ MemoryMatch.jsx # Vanilla JS game
โ โ โโโ TowerDefense.jsx # jQuery strategy game
โ โ โโโ CosmicDefender.jsx # React Three Fiber space shooter
โ โโโ GameUI.jsx # Reusable game interface
โ โโโ Header.jsx # Navigation header
โ โโโ Footer.jsx # Footer component
โโโ pages/
โ โโโ Home.jsx # Landing page with hero section
โ โโโ Games.jsx # Games catalog with tech showcase
โ โโโ About.jsx # About page
โ โโโ Contact.jsx # Contact form
โ โโโ NotFound.jsx # 404 page
โโโ hooks/
โ โโโ useThree.js # Custom Three.js hook
โโโ App.jsx # Main app with routing
โโโ main.jsx # React entry point
- Modern React-based 3D graphics
- Declarative Three.js components
- Physics simulation and interactive controls
- Used in: Cosmic Defender
- Hardware-accelerated 3D graphics
- GPU-powered rendering for immersive experiences
- Used in: Cube Adventure
- 2D graphics rendering with native browser APIs
- Particle effects and real-time animations
- Used in: Particle Storm
- Pure JavaScript DOM manipulation
- Event handling and fundamental web skills
- Used in: Memory Match
- Simplified DOM manipulation and animations
- Rapid game development and prototyping
- Used in: Tower Defense
- Node.js (version 16 or higher)
- npm or yarn
- Clone the repository:
git clone <repository-url>
cd WebGames- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser to
http://localhost:3001
npm run dev- Start development server with hot reloadnpm run build- Build optimized production bundlenpm run preview- Preview production build locallynpm run lint- Run ESLint for code quality
This project includes comprehensive testing using 5 different testing frameworks to ensure quality, compatibility, and performance across different browsers and environments.
- Purpose: React component testing, hooks, utility functions
- Features: React Testing Library, mocks for Three.js/Canvas APIs
- Coverage: Component rendering, user interactions, state management
npm test # Run all tests
npm run test:watch # Run in watch mode
npm run test:coverage # Generate coverage report- Purpose: Game logic, physics calculations, performance testing
- Features: Game mechanics validation, particle physics testing
- Coverage: Game rules, collision detection, memory management
npm run test:jasmine- Purpose: Full user journeys, integration testing
- Features: Real browser testing, custom game commands, video recording
- Coverage: Complete workflows, game interactions, navigation
npm run test:cypress # Open Cypress GUI
npm run test:cypress:run # Run headlessly- Purpose: Multi-browser compatibility, mobile testing
- Features: Chrome/Firefox/Safari testing, mobile simulation
- Coverage: Cross-browser compatibility, responsive design, performance
npm run test:playwright # Run all browsers
npm run test:playwright:ui # Open UI mode- Purpose: Legacy browser support, automated testing, CI/CD
- Features: WebDriver automation, accessibility validation
- Coverage: Browser automation, accessibility, performance monitoring
npm run test:seleniumEach framework tests different aspects of the games:
- ๐งช Unit Tests (Jest): Component rendering, props, state changes
- โ๏ธ Integration Tests (Jasmine): Physics systems, game mechanics
- ๐ E2E Tests (Cypress/Playwright): User workflows, game interactions
- ๐ง Browser Tests (Selenium): Cross-browser compatibility, accessibility
- Particle Storm: Canvas rendering, mouse interactions, particle physics
- Cube Adventure: Three.js scene loading, 3D interactions, WebGL compatibility
- Cosmic Defender: Keyboard controls (WASD + Space), collision detection
- Memory Match: Card flipping logic, game state management
- Tower Defense: Tower placement, enemy pathfinding, strategy validation
# Run all tests sequentially
npm run test:all
# Or use the custom test runner
node test-runner.js
# Run specific framework
node test-runner.js jest
node test-runner.js cypress
node test-runner.js playwright- Development server running on
http://localhost:3001 - Chrome browser installed (for Selenium/Playwright)
- All dependencies installed via
npm install
- Jest: Coverage reports in
coverage/directory - Cypress: Videos and screenshots in
tests/cypress/ - Playwright: HTML reports in
tests/playwright-report/ - Test Runner: Aggregated results in
test-results.json
For detailed testing documentation, see tests/README.md.
/- Home page with hero section/games- Games catalog with technology showcase/about- About page/contact- Contact form with validation/*- 404 Not Found page
/games/play/cube-adventure- Three.js 3D Game/games/play/particle-storm- HTML5 Canvas Game/games/play/memory-match- Vanilla JavaScript Game/games/play/tower-defense- jQuery Strategy Game/games/play/cosmic-defender- React Three Fiber Space Shooter
- Header with responsive navigation
- Main content area using React Router Outlet
- Footer with consistent branding
- Full-screen immersive gaming experience
- Back button for easy navigation
- Optimized for game performance
- Flexible dual-slot component system
- Vertical/horizontal/overlay configurations
- Used by Cosmic Defender for game canvas + controls
- React 18 - Modern UI library with Hooks
- React Router DOM - Client-side routing
- Material-UI - Component library and theming
- React Three Fiber - React-based 3D graphics
- Three.js - WebGL 3D graphics library
- HTML5 Canvas - 2D graphics rendering
- jQuery - DOM manipulation for legacy compatibility
- Vite - Fast build tool and dev server
- ESLint - Code linting and quality
- PostCSS - CSS processing
- Jest - Unit testing with React Testing Library
- Jasmine - Behavior-driven development testing
- Cypress - End-to-end testing with real browsers
- Playwright - Cross-browser and mobile testing
- Selenium WebDriver - Automated browser testing
- CSS3 - Modern styling with custom properties
- CSS Grid & Flexbox - Advanced layout systems
- Material-UI Theming - Consistent design system
- Responsive Design - Mobile-first approach
- Controls: WASD movement + Spacebar to fire
- Physics: Zero-gravity space environment
- Gameplay: Destroy asteroids, avoid collisions
- Visual Effects: Explosions, starfield, glowing UI
- Layout: Vertical split with 3D canvas and controls
- Consistent interface across all games
- Score tracking and statistics
- Start/pause/reset controls
- Game-specific instructions
- Responsive design for mobile
- Chrome (latest) - Full WebGL and Canvas support
- Firefox (latest) - Complete feature compatibility
- Safari (latest) - Optimized for mobile gaming
- Edge (latest) - Enhanced performance
- Code Splitting - Lazy loading for optimal bundle size
- Game Optimization - Efficient rendering and memory management
- Mobile Performance - Touch controls and responsive layouts
- Hot Module Reload - Fast development iteration
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-game) - Commit your changes (
git commit -m 'Add amazing new game') - Push to the branch (
git push origin feature/amazing-game) - Open a Pull Request
- Create game component in
src/components/games/ - Add route in
src/App.jsx - Update games list in
src/pages/Games.jsx - Include appropriate CSS styling
- Add comprehensive tests for all testing frameworks
- Test across different screen sizes
When contributing:
- Add unit tests for new components (Jest)
- Include game logic tests (Jasmine)
- Create E2E tests for user workflows (Cypress)
- Ensure cross-browser compatibility (Playwright/Selenium)
- Run
npm run test:allbefore submitting PRs
This project is licensed under the ISC License - see the LICENSE file for details.
- Three.js Community - For excellent 3D web graphics tools
- React Three Fiber Team - For bringing React to 3D development
- Vite Team - For the incredible build tool experience
- Testing Community - Jest, Cypress, Playwright, Selenium, and Jasmine teams
Built with โค๏ธ using modern web technologies for an immersive gaming experience.