Shark Escape - Android Source CodeShark Escape - Android Source Code
A thrilling, infinite native Android surfer game built in Java. Features score-based progressive difficulty, AdMob banner integratShark Escape - Android Source Code
A thrilling, infinite native Android surfer game built in Java. Features score-based progressive ...
Overview
Shark Escape is an exciting, endless mobile survival game built natively for Android using Java. Players control a surfer navigating through changing ocean waters, tapping left or right to avoid unpredictable dangers.
The project features a smart, score-based progressive difficulty system. As the player's score increases, the game automatically introduces new obstacles (switching from basic lifebuoys to aggressive sharks), keeping the gameplay highly engaging and addictive!
This is a complete, production-ready project template, making it an excellent opportunity for developers and publishers looking to launch a polished game on the Google Play Store quickly.
🎮 Features
Native Android Code: Built entirely in Java using a clean, lightweight custom 2D Canvas engine (SurfaceView). No heavy third-party frameworks required!
Progressive Difficulty System: Game logic dynamically shifts obstacle spawns based on the score (Lifebuoys for beginners, Sharks for advanced play).
AdMob Integration: Monestization-ready out of the box with a pre-configured AdMob Banner.
Local High Score System: SharedPreferences integration to automatically save and display the player's best score.
Audio Management: Complete sound effects handling for background music, scoring, and game-over collisions.
Smooth 60 FPS Gameplay: Optimized frame rate controller matching industry standards for responsive and fluid touch controls.
🛠️ What is Included in the Package?
* Complete Android Studio Source Code (Java).
* Ready-to-use game assets (Sprites, background, and audio files).
* Step-by-step documentation for importing, configuring, and publishing.
🎨 Easy to Reskin (Customize)
The code is heavily modular and highly organized. You can easily transform this game into any other theme (car racing, space shooter, plane avoider) simply by replacing the image files (`.png`) in the drawable folder and sound files (`.mp3`) in the raw folder, without touching the core game mechanics.
Features
📋 Technical Specifications & Features
Language & Platform: 100% Native Java development, fully compatible with the latest Android Studio versions.
Architecture: Structured with a dedicated Game Engine (`Runnable` loop) and `SurfaceView` implementation for lightweight performance.
Dynamic Spawn Logic:Score-based asset loading that automatically cycles between standard static hazards and advanced moving obstacles.
Optimized Rendering: Handled via standard Android Canvas (`drawBitmap`) ensuring high compatibility across low-end and high-end devices.
State Management: Robust GameState controller smoothly switching between Menu, Playing, and Game Over states.
Audio Pipeline: MediaPlayer` implementation with robust error handling (`try-catch`) preventing crashes on sound initialization.
Storage:Persistent data handling using `SharedPreferences` to securely save the user's High Score.
Layout & UI: Zero-action-bar theme configuration, preset to absolute vertical orientation (`portrait`) for a consistent mobile layout.
Requirements
⚙️ System Requirements
Android Studio: Bumblebee, Flamingo, Hedgehog, Jellyfish, or any newer version (Koala/Ladybug+ recommended).
Language: Java (JDK 11 or JDK 17 configured in Android Studio).
Minimum Android SDK:API 21 (Android 5.0 Lollipop) or higher.
Target Android SDK:API 34 or API 35 (Fully compliant with the latest Google Play Store policies).
Build System: Gradle (Compatible with Gradle 8.0+ wrapper included in the project).
Operating System (Developer): Windows, macOS, or Linux running Android Studio.
Instructions
🚀 Setup & Customization Instructions
Follow these clear steps to get your game up and running in minutes:
Step 1: Extract and Open
1. Download and extract the `.zip` file onto your computer.
2. Open **Android Studio**, click on **File > Open**, and select the project root folder.
3. Wait for the automatic Gradle Sync to complete. Make sure you have an active internet connection for the initial build dependencies.
Step 2: Test the Game
1. Connect your Android physical device via USB (with Developer Options enabled) or open an Android Virtual Device (Emulator).
2. Click the green Run (Play) button in the top toolbar of Android Studio to compile and install the app.
Step 3: Change the Package Name & App ID
1. In the project tree view on the left, click the Gear Icon (Settings) and disable Compact Middle Packages.
2. Right-click on the `SharkEscape` package folder, select Refactor > Rename**, choose Rename Package, and type your custom name in lowercase.
3. Open `app/build.gradle` and update both the `namespace` and `applicationId` lines to match your new package name exactly.
4. Go to Build > Clean Project**, then Build > Rebuild Project.
Step 4: Add Your AdMob Unit IDs
1. Open `MainActivity.java` and locate the line with `adView.setAdUnitId(...)`. Replace the default Google test ID with your official AdMob Banner Unit ID.
2. Open `AndroidManifest.xml` and replace the `com.google.android.gms.ads.APPLICATION_ID` meta-data value with your actual AdMob App ID.
Step 5: Reskinning the Graphics & Audio
1. To change images, navigate to `app/src/main/res/drawable` and overwrite the `.png` files with your custom graphics (ensure names match exactly, like `carro_player.png`, `obstaculo.png`, and `obstaculo_boia.png`).
2. To change audio, go to `app/src/main/res/raw` and replace the audio files with your own `.mp3` tracks using the original file names.
| Category | App Templates / Android / Games / Casual |
| First release | 21 May 2026 |
| Last update | 21 May 2026 |
| Operating Systems | Android 7.0, Android 8.0, Android 9.0, Android 10.0, Android 11.0, Android 12.0, Android 4.0, Android 5.0, Android 6.0 |
| Files included | .apk, .java, build.settings |
| Tags | source code, java game, android game, endless runner, simple reskin, Mobile Template, complete project, casual game, arcade game, native android, admob integrated, premium source code, shark escape, surfer game, progressive difficulty |








