Stamina Shop

개요

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.
  2. 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).
  3. The shelf lists three products: +5 stamina for 30 coins, +15 stamina for 70 coins and +40 stamina for 100 coins.
  4. Press Buy on any product; its price comes out of Free balance and the Stamina gauge goes up by its recovery amount.
  5. 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: 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: GS2-Stamina holds the stamina meter (maximum 100, recovering 5 every minute) and refills it by the product’s amount on purchase.
  • GS2-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 를 선택하고 아래 패키지를 입력합니다.

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

소스 코드