Skip to content

Commit

Permalink
[Examples/Turnip Town] Rewrite to leverage Kiosk Apps
Browse files Browse the repository at this point in the history
This is an almost complete rewrite of the demo. Now, instead of
demonstrating shared/permissioned access to a game between the game
admin/service and the player, we are demonstrating a game that allows
multiple players to interact with each other's resources.

Additionally, instead of a "weather" dynamic, crops are watered by
individuals, fetching water from a well that outputs a fixed quantity
of water every epoch (it does not accumulate).

The parameters of the game are now as follows:

- Turnips need as much water as their size to stay fresh every day.
- They can grow an additional 20 size units a day if given enough
  water (1 unit of water = 1 unit of growth).
- Each player gets access to 100 units of water per day, via their
  well. Water must be used in the transaction it was fetched from the
  well -- it cannot be stockpiled.
- If there is more than 100 units of additional water left, it is
  stagnant and the turnip will also lose freshness (it will rot).
- Turnips need to grow to at least 50 units before they can be
  harvested.
- Each player owns a field and a well. Only they can plant turnips on
  their field, and take water from their well.
- Any player can water crops in anybody else's field, and any player
  can harvest crops as well, but harvested crops go to the field
  owner's Kiosk.

New tests have been added for all these features -- test coverage for
this package is 99.14%.
  • Loading branch information
amnn committed May 24, 2024
1 parent a8df961 commit 3b46169
Show file tree
Hide file tree
Showing 12 changed files with 1,212 additions and 722 deletions.
3 changes: 1 addition & 2 deletions examples/turnip-town/move/Move.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[package]
name = "turnip-town"
version = "0.0.1"
edition = "2024.beta"

[dependencies]
Kiosk = { local = "../../../kiosk" }
Sui = { local = "../../../crates/sui-framework/packages/sui-framework" }

[addresses]
Expand Down
42 changes: 0 additions & 42 deletions examples/turnip-town/move/sources/admin.move

This file was deleted.

Loading

0 comments on commit 3b46169

Please sign in to comment.