A fun and addictive physics-based puzzle game where you drop and merge fruits to create bigger ones! Built with vanilla JavaScript and HTML5 Canvas.
Experience the addictive fruit-merging gameplay with realistic-ish physics and beautiful visual effects!
- Drop Fruits: Click anywhere on the game area or use the "Drop Fruit" button to release fruits
- Merge Strategy: When two identical fruits touch, they merge into the next fruit in the evolution chain
- Stack Carefully: Fruits stack with realistic physics - plan your drops to create efficient merges
- Avoid Game Over: Don't let fruits pile up above the danger line for too long
- Score Points: Earn points for each successful merge - bigger fruits = more points!
๐ โ ๐ โ ๐ซ โ ๐ โ ๐ฅ โ ๐ โ ๐ โ ๐ โ ๐ โ ๐ฅญ โ ๐ โ ๐ฅฅ
Start with cherries and work your way up to the ultimate coconut!
- Physics-Based Movement: Realistic fruit dropping and collision detection
- Merge Mechanics: Identical fruits combine into evolved forms
- Score System: Points awarded based on fruit size and merge complexity
- Next Fruit Preview: See your next 3 fruits to plan ahead
- Anti-Compression System: Prevents fruits from overlapping unrealistically
- Boundary Collision: Fruits bounce off walls and stack naturally
- Danger Mode: Visual warning when fruits get too high
- Responsive Design: Works on desktop and mobile browsers
- Smooth Animations: 60 FPS canvas rendering for fluid gameplay
- Clean UI: Modern, intuitive interface
- Fruit Guide: Visual evolution chain reference
- Game Over Screen: Clear feedback with final score
- Restart Functionality: Quick game reset with clean state
-
Clone this repository:
git clone https://github.com/yourusername/fruit-merge-game.git cd fruit-merge-game -
Start a local server:
# Using Python 3 python3 -m http.server 8000 # Using Node.js npx serve . # Using PHP php -S localhost:8000
-
Open your browser and navigate to
http://localhost:8000
- Download the
FruitGame.apkfile from the releases - Enable "Install from Unknown Sources" in your Android settings
- Install the APK and enjoy mobile gaming!
The game includes a native Android APK built with Apache Cordova:
- Offline Play: No internet connection required
- Touch Controls: Optimized for mobile interaction
- Native Performance: Smooth gameplay on Android devices
- Full Feature Parity: All web features available on mobile
fruit-merge-game/
โโโ index.html # Main game page
โโโ script.js # Game logic and physics
โโโ style.css # Styling and layout
โโโ FruitGame.apk # Android APK build
โโโ FruitGameAndroid/ # Cordova project files
โโโ README.md # This file
- HTML5 Canvas: For game rendering and animations
- Vanilla JavaScript: Core game logic and physics engine
- CSS3: Modern styling and responsive design
- Apache Cordova: Mobile app packaging
The game implements a custom physics engine featuring:
- Collision Detection: Circle-based collision with optimized algorithms
- Velocity Calculations: Realistic momentum and bounce effects
- Separation Logic: Anti-compression system prevents unrealistic stacking
- Boundary Handling: Proper wall and floor collision responses
- Detection: Efficient distance-based collision detection
- Resolution: Physics-based separation with velocity dampening
- Merging: Automatic fruit evolution when identical fruits collide
- Boundaries: Proper handling of wall and floor interactions
- Base Points: Each fruit type has a base point value
- Merge Bonus: Additional points for successful combinations
- Chain Reactions: Bonus multipliers for consecutive merges
- Size Scaling: Larger fruits provide exponentially more points
- Fruit Variety: Random selection from available fruit types
- Preview System: Strategic planning with next fruit visibility
- Danger Zone: Escalating tension as fruits approach the limit
- Game Over: Clear failure conditions with recovery options
No build process required - just serve the files statically.
-
Install dependencies:
npm install -g cordova brew install --cask temurin@17 brew install android-commandlinetools gradle
-
Set up environment:
export ANDROID_HOME=/usr/local/share/android-commandlinetools export JAVA_HOME=/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home
-
Build APK:
cd FruitGameAndroid cordova build android
Contributions are welcome! Here are some ways you can help:
- ๐ Bug Reports: Found an issue? Open a GitHub issue
- ๐ก Feature Ideas: Suggest new gameplay mechanics or improvements
- ๐จ Visual Enhancements: Improve graphics, animations, or UI
- ๐ฑ Platform Support: Help expand to iOS or other platforms
- ๐งช Testing: Test on different devices and browsers
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).
You are free to:
- Share โ copy and redistribute the material in any medium or format
- Adapt โ remix, transform, and build upon the material
Under the following terms:
- Attribution โ You must give appropriate credit, provide a link to the license, and indicate if changes were made
- NonCommercial โ You may not use the material for commercial purposes
- ShareAlike โ If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original
See the full license at: https://creativecommons.org/licenses/by-nc-sa/4.0/
- Inspired by the popular Suika Game (Watermelon Game)
- Physics concepts adapted from various game development resources
- Emoji fruits for visual appeal and universal recognition
- Community feedback for gameplay improvements
- Lines of Code: ~500 JavaScript, ~200 CSS, ~50 HTML
- File Size: ~3.4MB APK, <100KB web version
- Performance: 60 FPS on modern devices
- Compatibility: Chrome 60+, Firefox 55+, Safari 12+, Android 7+
Ready to play? ๐ฎ Start Game | ๐ฑ Download APK
Made with โค๏ธ and lots of fruit emojis!
