Added meta tags for better iOS web app integration and restricted viewport scaling in index.html. Updated styles.css to prevent scrolling, fix body to viewport, and disable text selection for a more app-like experience on mobile devices. |
||
|---|---|---|
| .dockerignore | ||
| christmas-breakout.tar | ||
| docker-compose.yml | ||
| Dockerfile | ||
| game.js | ||
| index.html | ||
| README.md | ||
| styles.css | ||
🎄 Christmas Breakout Game 🎄
A mobile-first breakout/brick-breaker game with a festive Christmas theme. Clear levels, earn Christmas gifts, and share your victory on ntfy.sh!
Features
✨ Mobile-First Design
- Fully responsive gameplay optimized for mobile devices
- Touch controls and device orientation (tilt) support
- Beautiful Christmas-themed UI with gradients and animations
🎮 Progressive Levels
- 3 challenging levels with increasing difficulty
- More bricks and faster ball speed as you progress
- Smooth gameplay at 60 FPS
🎁 Christmas Rewards
- Unique Christmas gifts for each level completion
- Gift animations and celebratory effects
- Random gift selection from a festive list
📢 Social Integration
- Enter your name at the start
- Automatic notifications sent to ntfy.sh when you clear a level
- Share your achievements instantly
🎯 Game Mechanics
- Physics-based ball and paddle collision detection
- Responsive paddle movement (mouse, touch, or device tilt)
- Score tracking throughout the game
How to Play
- Enter Your Name: Start the game by entering your name
- Move the Paddle:
- On desktop: Move your mouse
- On mobile: Swipe your finger or tilt your device
- Break the Bricks: Use the paddle to bounce the ball up and break all bricks
- Complete Levels: Clear all bricks to earn a Christmas gift and advance
- Earn Points: Gain 10 points per brick destroyed
Controls
| Device | Control |
|---|---|
| Desktop | Mouse movement |
| Mobile (Touch) | Tap and drag or swipe |
| Mobile (Accelerometer) | Tilt device left/right |
Customization
Difficulty Levels
Edit game.js GAME_CONFIG.levels to adjust:
brickRows: Number of brick rowsbrickCols: Number of brick columnsballSpeed: Ball movement speed
Christmas Gifts
Modify GAME_CONFIG.christmasGifts array to customize reward messages.
Colors & Styling
Edit styles.css to change:
- Background gradient colors
- Button colors
- Brick colors
- Game canvas appearance
Notification Channel
Change the ntfy.sh channel in game.js sendNotification() method:
await fetch('https://ntfy.sh/YOUR_CHANNEL_NAME', {
Installation & Running
Option 1: Using VS Code Live Server
- Install the Live Server extension
- Right-click
index.htmland select "Open with Live Server"
Option 2: Using Python HTTP Server
python -m http.server 8000
Then visit http://localhost:8000
Option 3: Using Node.js http-server
npx http-server
Browser Support
- Chrome/Edge 60+
- Firefox 55+
- Safari 11+
- Mobile browsers (iOS Safari, Chrome Android)
API Integration
ntfy.sh Notifications
When a player completes a level, a POST request is sent to:
https://ntfy.sh/davidtaljsten
With the message format:
🎉 [PlayerName] cleared level [X] and earned: [Gift]! Score: [Score]
No authentication required - ntfy.sh creates the channel automatically on first use.
Project Structure
/
├── index.html # Main HTML file with game structure
├── styles.css # CSS styling and animations
├── game.js # Game logic and mechanics
└── README.md # This file
Technical Details
Game Engine
- Vanilla JavaScript (no frameworks)
- HTML5 Canvas for rendering
- RequestAnimationFrame for 60 FPS gameplay
Physics
- Basic collision detection (AABB)
- Vector-based ball movement
- Dynamic paddle bounce angles
Responsive Design
- CSS media queries for different screen sizes
- Canvas scaling to device width
- Touch-action: none for smooth interactions
Future Enhancements
- Power-ups (larger paddle, multi-ball, slow motion)
- Sound effects and music
- Local leaderboard with localStorage
- More levels and difficulty modes
- Pause/resume functionality
- Mobile app wrapper (PWA/Cordova)
License
Free to use and modify for personal projects.
Enjoy! 🎄🎁
Clear all the bricks, earn your Christmas gifts, and spread the holiday cheer! 🎉