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

# Stamina

Manages a stamina meter that recovers over time.




**이 데모에 대하여**

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

## 개요

The page shows a stamina gauge that recovers over time, plus two buttons that spend and restore stamina. The meter holds 50 and recovers 5 every minute on its own, so leaving the page open shows the gauge and the time to the next recovery moving. The recover button also demonstrates overflow, which lets stamina go past the maximum up to 100.

## 체험 방법

1. The **Stamina** gauge under **Your stamina** shows the current value, e.g. **50/50**. A new player starts full at 50.
1. Press **Spend** to consume 10 stamina.
1. Once the meter is below full, **Next recovery** counts down to the next tick, and stamina recovers by 5 every minute. The row is hidden while the meter is full.
1. Press **Recover** to restore 5 stamina immediately. Pressing it while full is not wasted: the value goes past the maximum, e.g. **55/50**, up to 100.

Automatic recovery stops at the maximum of 50. Stamina above 50 from **Recover** does not grow further on its own until spending brings it back below 50.

## 사용하는 GS2 서비스

- [GS2-Stamina](/ko/microservices/stamina/): A GS2-Stamina model defines a maximum of 50, recovery of 5 every minute, and an overflow ceiling of 100, and tracks each player's current value and next recovery time.
- [GS2-Exchange](/ko/microservices/exchange/): Two GS2-Exchange rates define the transactions behind **Spend** (consume 10 stamina) and **Recover** (restore 5), executed server-side automatically.

## GS2 Studio에서 사용하기

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

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

- Owner: `gs2io`
- Repository: `gs2-studio-package`
- Subdirectory: `foundation-economy-energy/packages/foundation-economy-energy`

## 소스 코드

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



