Tetris
A modern Tetris game built with HTML5, CSS3, and JavaScript. This game supports:
- Multiple languages (Català and English)
- In-game instructions screen with visual guides
- Mobile and desktop controls
- High scores with Firebase integration
- Multiplayer mode (Online Deathmatch)
- Background music
- Progressive difficulty levels
- Game Boy-inspired retro design
The game is deployed at: [GitHub Pages URL]
To enable the multiplayer mode (Online Deathmatch), you need to configure Firebase Realtime Database security rules. Choose one of these options:
- FIREBASE_QUICK_START.md - Quick manual setup (5 minutes)
- FIREBASE_CLI_DEPLOYMENT.md - Automatic deployment with Firebase CLI
- FIREBASE_SETUP.md - Complete setup guide with security options
If you encounter errors like "permission_denied at /rooms", see TROUBLESHOOTING.md.
This project can be compiled into Android APK and iOS IPA using Capacitor.
- Node.js 18 or higher
- Java Development Kit (JDK) 17
- Android SDK (automatically downloaded by Gradle)
- macOS (required for iOS development)
- Xcode 14.0 or higher
- CocoaPods
- Node.js 18 or higher
- Install dependencies:
npm install- Build the web app:
npm run build- Add mobile platforms:
# For Android
npx cap add android
# For iOS (macOS only)
npx cap add ios
cd ios/App && pod install && cd ../..- Sync with platforms:
npx cap synccd android
./gradlew assembleDebugThe APK will be located at: android/app/build/outputs/apk/debug/app-debug.apk
cd android
./gradlew assembleReleaseThe APK will be located at: android/app/build/outputs/apk/release/app-release-unsigned.apk
Note: For a production release, you'll need to sign the APK with a keystore.
- Open the iOS project in Xcode:
npx cap open ios- In Xcode:
- Select target device: Any iOS Device (arm64)
- Go to Product → Archive
- Once archived, click Distribute App
- Follow the wizard to export or upload to App Store Connect
Note: You need an Apple Developer account ($99/year) to distribute on the App Store.
The project includes GitHub Actions workflows that automatically build both Android APK and iOS IPA on every push to the main branch:
- Android APK: Builds a debug APK that can be installed on Android devices
- iOS IPA: Builds a simulator IPA that can be tested on iOS Simulator (macOS only)
The build artifacts are available in the Actions tab of the repository and are retained for 30 days.
Note: The iOS workflow builds for the iOS Simulator. To build for physical iOS devices, you need an Apple Developer account and code signing certificates. See APP_STORE_GUIDE.md for details.
For complete instructions on preparing and publishing this app to Google Play Store, see:
- PLAY_STORE_QUICK_START.md - Quick reference guide
- PLAY_STORE_GUIDE.md - Comprehensive step-by-step guide
These guides cover:
- Keystore generation and signing configuration
- App icon creation
- Privacy policy requirements
- Store listing materials (screenshots, descriptions)
- AAB/APK build and submission process
For complete instructions on preparing and publishing this app to Apple App Store, see:
- APP_STORE_QUICK_START.md - Quick reference guide
- APP_STORE_GUIDE.md - Comprehensive step-by-step guide
These guides cover:
- Apple Developer account setup
- Certificate and provisioning profile creation
- App icon and launch screen configuration
- App Store Connect submission process
- Screenshots and metadata requirements
To modify the game:
- Edit
index.html,script.js, orstyles.css - Run
npm run buildto copy files to thewwwdirectory - Run
npx cap syncto update mobile projects - Build for Android or iOS as described above
# Build & Development
npm run build # Build web app
npm run cap:add:android # Add Android platform
npm run cap:add:ios # Add iOS platform
npm run cap:sync # Sync with all platforms
npm run cap:open:android # Open in Android Studio
npm run cap:open:ios # Open in Xcode
# Mobile Builds
npm run android:build # Build debug APK
npm run android:build:release # Build release APK
npm run ios:build # Prepare for iOS build
# Firebase Deployment
npm run firebase:login # Login to Firebase
npm run firebase:deploy:database # Deploy database rules only
npm run firebase:deploy # Deploy everything (database + hosting)ISC