From 0397c9f991752e193bde19ab8b1c3ac7c5e90263 Mon Sep 17 00:00:00 2001 From: Adrian Gaudebert Date: Tue, 22 Oct 2024 17:15:35 +0200 Subject: [PATCH] Added the warehouse and granary to store resources. --- src/App.svelte | 18 ++++----- src/app.css | 3 -- src/buildings.ts | 72 ++++++++++++++++++++++++++++++------ src/hud/Resources.svelte | 21 +++++++++++ src/moves/upgradeBuilding.ts | 2 +- src/types.ts | 4 ++ src/update.ts | 17 +++++++-- src/utils.ts | 46 +++++++++++++++++++++++ src/village.ts | 28 +++++++------- 9 files changed, 168 insertions(+), 43 deletions(-) create mode 100644 src/hud/Resources.svelte create mode 100644 src/utils.ts diff --git a/src/App.svelte b/src/App.svelte index 72933a1..4802de8 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,6 +1,7 @@
-
-
    -
  • Wood: { Math.floor($village.resources.wood) }
  • -
  • Stone: { Math.floor($village.resources.stone) }
  • -
  • Iron: { Math.floor($village.resources.iron) }
  • -
  • Food: { Math.floor($village.resources.food) }
  • -
-
+
+ +
{ #each $village.buildings as building }
-

{ building.name }

-

Level: { building.level }

+

{ building.name } ({ building.level })