> For the complete documentation index, see [llms.txt](/llms.txt)


# Learn GS2 by building an adventure game

Build a small adventure game step by step, from login to rewards and a shop.



Clear quests to collect coins, then spend them to restore stamina. Learn GS2 by building this small game, including the ability to close the app and continue with the same player.

You should be able to open a Unity project and run a scene. No previous GS2 experience is needed.

## The game you will build

1. Log in and select a quest.
2. Spend stamina to start it.
3. Clear it to receive coins.
4. When stamina runs low, spend coins to restore it and try another quest.

Build the interface in Unity and manage quest settings and player data in GS2. Use a **Complete** button instead of combat so you can focus on exchanging data with GS2 first.

## See it in the demos

In the <a href='' target="_blank" rel="noopener">quest demo (new tab)</a>, use **Forest patrol → Start** to spend stamina and begin, then **Complete** to receive coins. This demo also includes a first-clear bonus.

In the <a href='' target="_blank" rel="noopener">stamina shop demo (new tab)</a>, use **Get coins → Deposit** to receive coins, then click **Buy** on a product under **The shelf** to restore stamina.

## Follow this sequence

```mermaid
flowchart TD
    B[Prepare the development environment] --> C[Build login and the quest list]
    C --> D[Receive rewards and resume after restarting]
    D --> E[Add stamina and a shop]
    E --> F[Change settings and handle connection errors]
    F --> H[Add features in the extensions]
```

Follow **Next** at the bottom of each page to work through the tutorial. The first four chapters cover login, quests, rewards, and resuming after a restart. Then add stamina and a shop, and test network error handling. The extensions add features such as login bonuses to the same game.

Each chapter includes checks to try in the game and a short exercise.

[Next: Prepare your development environment]()




- [1. Create an account and log in](/en/get_start/adventure/lessons/01-login/)
  
- [2. Add a quest and display the quest list](/en/get_start/adventure/lessons/02-quests/)
  
- [3. Start a quest and receive rewards](/en/get_start/adventure/lessons/03-rewards/)
  
- [4. Restart and continue playing](/en/get_start/adventure/lessons/04-resume/)
  
- [5. Spend stamina when starting a quest](/en/get_start/adventure/lessons/05-stamina/)
  
- [6. Restore stamina with coins](/en/get_start/adventure/lessons/06-shop/)
  
- [7. Change settings and apply them to the game](/en/get_start/adventure/lessons/07-update/)
  
- [8. Handle network errors and repeated clicks](/en/get_start/adventure/lessons/08-failures/)
  
- [Extensions: add more features to the game](/en/get_start/adventure/extensions/)
  
- [Prepare your development environment](/en/get_start/adventure/start/setup/)
  
- [Realtime: Synchronize two players](/en/get_start/adventure/realtime/)
  
- [Samples and reference](/en/get_start/adventure/resources/)
  
