diff --git a/constants.js b/constants.js index 27b2b31..cb3b65b 100644 --- a/constants.js +++ b/constants.js @@ -25,6 +25,11 @@ const buildings = { "name": "House", "cost": 1e5, "prod": 100 + }, + "universe": { + "name": "Universe", + "cost": 1e15, + "prod": 1e14 } } diff --git a/gorge.html b/gorge.html index be52121..35107fd 100644 --- a/gorge.html +++ b/gorge.html @@ -21,23 +21,13 @@
Resources
Food: 0
+
Buildings
-
-
Tasty micro
-
potatoes?
-
-
-
Tasty micro
-
potatoes?
-
-
Tasty micro
-
potatoes?
-
-
Tasty micro
-
potatoes?
-
-
Tasty micro
-
potatoes?
+ +
+
Upgrades
+
+ diff --git a/gorge.js b/gorge.js index 72e2154..4c89756 100644 --- a/gorge.js +++ b/gorge.js @@ -77,6 +77,7 @@ function eatMicro() { function setup() { initializeData(); + createButtons(); registerListeners(); console.log(belongings) @@ -98,6 +99,35 @@ function registerListeners() { document.querySelector("#tasty-micro").addEventListener("click", eatMicro); } +function createButtons() { + createBuildings(); + createUpgrades(); +} + +function createBuildings() { + let container = document.querySelector("#buildings-area"); + + for (const [key, value] of Object.entries(buildings)) { + console.log(key, value) + let button = document.createElement("div"); + button.classList.add("building-button"); + button.id = "building-" + key; + let buttonName = document.createElement("div"); + buttonName.classList.add("building-button-name"); + let buttonCost = document.createElement("div"); + buttonCost.classList.add("building-button-cost"); + + button.appendChild(buttonName); + button.appendChild(buttonCost); + + container.appendChild(button); + } +} + +function createUpgrades() { + // wat +} + window.onload = function() { setup();