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

# Stamina Shop

A shop that sells products to refill stamina.




**이 데모에 대하여**

데모는 익명 계정으로 자동 로그인합니다. 이 계정은 쇼룸의 모든 데모에서 공유되므로 한 데모에서 얻은 아이템이나 재화가 다른 데모에도 반영됩니다. 로딩에 약간 시간이 걸립니다. 화면이 작다면 새 탭에서 열어 사용해 보세요.

## 개요

A shop that sells stamina for coins. Collect free coins under **Get coins**, use some stamina under **Your stamina**, then buy one of the three refill tiers on **The shelf**. Each purchase is a GS2-Exchange exchange that withdraws coins from GS2-Money2 and refills GS2-Stamina in one transaction.

## 체험 방법

1. Press **Deposit** under **Get coins**; **Free balance** under **Your coins** goes up by 100.
1. Press **Spend** under **Your stamina** to use 10 stamina (maximum 100, starting at 50). While the meter is not full, **Next recovery** shows the time until the next natural recovery (5 every minute).
1. **The shelf** lists three products: **+5 stamina for 30 coins**, **+15 stamina for 70 coins** and **+40 stamina for 100 coins**.
1. Press **Buy** on any product; its price comes out of **Free balance** and the **Stamina** gauge goes up by its recovery amount.
1. **Buy** is refused when you do not have enough coins; press **Deposit** under **Get coins** to top up.

The stamina model allows overflow, so buying near a full meter can take it past 100.

## 사용하는 GS2 서비스

- [GS2-Exchange](/ko/microservices/exchange/): One GS2-Exchange rate per product turns the coin cost and the stamina refill into a single purchase transaction; the free-coin deposit and the stamina spend are exchange rates too.
- [GS2-Stamina](/ko/microservices/stamina/): GS2-Stamina holds the stamina meter (maximum 100, recovering 5 every minute) and refills it by the product's amount on purchase.
- [GS2-Money2](/ko/microservices/money2/): The GS2-Money2 wallet holds the free coins, and each purchase withdraws the product's price from it.

## GS2 Studio에서 사용하기

GS2 Studio의 Simple 모드에서 **Add features** 를 열고 **Stamina Shop** 의 **Add** 를 누르면 이 기능을 자신의 프로젝트에 가져올 수 있습니다. 패키지를 직접 지정하려면 **Add from GitHub** 를 선택하고 아래 패키지를 입력합니다.

```text
https://github.com/gs2io/gs2-studio-package/tree/main/micro-shop-energy/packages/micro-shop-energy
```

- Owner: `gs2io`
- Repository: `gs2-studio-package`
- Subdirectory: `micro-shop-energy/packages/micro-shop-energy`

## 소스 코드

- 데모 프로젝트: <https://github.com/gs2io/gs2-studio-package/tree/main/micro-shop-energy/live-demo>
- 기능 패키지: <https://github.com/gs2io/gs2-studio-package/tree/main/micro-shop-energy>



