> For the complete documentation index, see [llms.txt](https://savali-escape.gitbook.io/savali-escape-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://savali-escape.gitbook.io/savali-escape-docs/project-details/game-mechanics.md).

# Game Mechanics

**Target platforms:**

*1. Google Play* \
*2. App-Store*

**Tools and processes used in game development:**

*1. Unity – Game engine used for development (code is written in C#).*\
*2. Unity Gaming Services – Services ucsed for player authentication and leaderboards.*\
*3. Unity Ads – Service used for monetization (advertisement).*\
*4. Google Firebase Realtime Database – Database used to store collected wallets.*

**Game mechanics and functionalities:**

1. *Player Movement: 2D movement (left, right, jump) with two control schemes (buttons or joystick + button), customizable via a controller button on the main page.*
2. *Enemy Movement: Enemies spawn with random directions, move at constant speed, and adjust direction upon collision, with a boost feature to prevent getting stuck.*
3. *Player Lives: Start with 5 lives; lose one per enemy collision, triggering respawn.*
4. *Lives Restoration: Restores 1 life every 5 minutes, even when the game is offline, with a visible timer.*
5. *Player Respawn: Respawns at death location with a 3-second invincibility period.*
6. *Enemy Revival: Enemies sleep for 10 seconds after being hit by a brick, then revive.*
7. *Side Portals: Teleport players and enemies between the left and right sides of the screen.*
8. *Bricks: Primary weapon; hit from below to defeat enemies. Variants include slowing bricks (slows player) and fragile bricks (disappear when touched by player).*
9. *Enemy Spawn Points: Two spawn points (top left, top right) with level-specific timing.*
10. *Game Points: Earned by collecting enemies (15), UFOs (15), power-up boxes (40), or hitting the boss (20/hit). Saved only on level completion.*
11. *Surprise Power-Up: Randomly appearing boxes grant points, speed/jump boosts, or penalties.*
12. *Level Management: Complete a level by reaching a target score and collecting all enemies; limited simultaneous enemies; game over at 0 lives until restored.*
13. *Boss Enemy: Appears at level 15 with 7 lives, teleports to player’s level per hit, speeds up near player, and dies permanently (no collection needed).*
14. *Leaderboard: Displays top 10 players; username chosen at first startup.*
15. *Level Saving: Last played level is saved; checkpoints at levels 1, 6, and 11 (Stages 1-3).*
