From 43934c8fa78ab4b3c110f6e5c33b6085fa1ca8c6 Mon Sep 17 00:00:00 2001 From: kotlinc <131211966+kotlinc@users.noreply.github.com> Date: Sun, 15 Oct 2023 07:56:29 +1100 Subject: [PATCH] back to typescript and saves (not loads) --- buildings.ts | 94 +++--- buildings.js => dist/buildings.js | 193 ++++++------ index.html | 2 +- new.coffee | 290 ----------------- new.js | 505 ------------------------------ tsconfig.json | 112 +++++++ 6 files changed, 272 insertions(+), 924 deletions(-) rename buildings.js => dist/buildings.js (63%) delete mode 100644 new.coffee delete mode 100644 new.js create mode 100644 tsconfig.json diff --git a/buildings.ts b/buildings.ts index be3d903..3e8046b 100644 --- a/buildings.ts +++ b/buildings.ts @@ -1,42 +1,42 @@ -var grill: HTMLAudioElement | null = new Audio("designed-fire-winds-swoosh-04-116788.mp3") -var bun: HTMLAudioElement | null = new Audio("crunch-crispy-breadbun-41340.mp3") -var dad: HTMLAudioElement | null = new Audio("dad-says-yummy-113126.mp3") -var farm: HTMLAudioElement | null = new Audio("zapsplat_impacts_hit_loose_ground_dirt_impact_collapse_fall_013_102682.mp3") -var factory: HTMLAudioElement | null = new Audio("some-kind-of-machine-103152.mp3") -var bank: HTMLAudioElement | null = new Audio("cash-register-purchase-87313.mp3") -var ambience: HTMLAudioElement | null = new Audio("./Hotdog-Clicker-Ambience.m4a") +const grill: HTMLAudioElement | null = new Audio("designed-fire-winds-swoosh-04-116788.mp3") +const bun: HTMLAudioElement | null = new Audio("crunch-crispy-breadbun-41340.mp3") +const dad: HTMLAudioElement | null = new Audio("dad-says-yummy-113126.mp3") +const farm: HTMLAudioElement | null = new Audio("zapsplat_impacts_hit_loose_ground_dirt_impact_collapse_fall_013_102682.mp3") +const factory: HTMLAudioElement | null = new Audio("some-kind-of-machine-103152.mp3") +const bank: HTMLAudioElement | null = new Audio("cash-register-purchase-87313.mp3") +const ambience: HTMLAudioElement | null = new Audio("./Hotdog-Clicker-Ambience.m4a") ambience.loop = true; -var bunBuyable: string = "./Can-Buy-Bun-Button.svg" -var bunUnBuyable: string = "./Cant-Buy-Bun-Button.svg" -var bunBuying: string = "./Buying-Bun-Button.svg" +const bunBuyable: string = "./Can-Buy-Bun-Button.svg" +const bunUnBuyable: string = "./Cant-Buy-Bun-Button.svg" +const bunBuying: string = "./Buying-Bun-Button.svg" -var dadBuyable: string = "./Can-Buy-Dad-Button.svg" -var dadUnBuyable: string = "./Cant-Buy-Dad-Button.svg" -var dadBuying: string = "./Buying-Dad-Button.svg" +const dadBuyable: string = "./Can-Buy-Dad-Button.svg" +const dadUnBuyable: string = "./Cant-Buy-Dad-Button.svg" +const dadBuying: string = "./Buying-Dad-Button.svg" -var grillBuyable: string = "./Can-Buy-Grill-Button.svg" -var grillUnBuyable: string = "./Cant-Buy-Grill-Button.svg" -var grillBuying: string = "./Buying-Grill-Button.svg" +const grillBuyable: string = "./Can-Buy-Grill-Button.svg" +const grillUnBuyable: string = "./Cant-Buy-Grill-Button.svg" +const grillBuying: string = "./Buying-Grill-Button.svg" -var farmBuyable: string = "./Can-Buy-Farm-Button.svg" -var farmUnBuyable: string = "./Cant-Buy-Farm-Button.svg" -var farmBuying: string = "./Buying-Farm-Button.svg" +const farmBuyable: string = "./Can-Buy-Farm-Button.svg" +const farmUnBuyable: string = "./Cant-Buy-Farm-Button.svg" +const farmBuying: string = "./Buying-Farm-Button.svg" -var facBuyable: string = "./Can-Buy-Fac-Button.svg" -var facUnBuyable: string = "./Cant-Buy-Fac-Button.svg" -var facBuying: string = "./Buying-Fac-Button.svg" +const facBuyable: string = "./Can-Buy-Fac-Button.svg" +const facUnBuyable: string = "./Cant-Buy-Fac-Button.svg" +const facBuying: string = "./Buying-Fac-Button.svg" -var bankBuyable: string = "./Can-Buy-Bank-Button.svg" -var bankUnBuyable: string = "./Cant-Buy-Bank-Button.svg" -var bankBuying: string = "./Buying-Bank-Button.svg" +const bankBuyable: string = "./Can-Buy-Bank-Button.svg" +const bankUnBuyable: string = "./Cant-Buy-Bank-Button.svg" +const bankBuying: string = "./Buying-Bank-Button.svg" let passiveClicks: number = 0; let clickCount: number = 0; let bunCount: number = 0; let dadCount: number = 0; let grillCount: number = 0; -let dogFarmCount: number = 0; +let farmCount: number = 0; let facCount: number = 0; let bankCount: number = 0; @@ -49,8 +49,8 @@ let dadRate: number = 2; let grillCost: number = 500; let grillRate: number = 10; -let dogFarmCost: number = 5000; -let dogFarmRate: number = 50; +let farmCost: number = 5000; +let farmRate: number = 50; let facCost: number = 50000; let facRate: number = 500; @@ -66,7 +66,7 @@ const clickCountElement: HTMLElement | null = document.getElementById("clickCoun const grillCountElement: HTMLElement | null = document.getElementById("grillCount"); const bunCountElement: HTMLElement | null = document.getElementById("bunCount"); const dadCountElement: HTMLElement | null = document.getElementById("dadCount"); -const dogFarmCountElement: HTMLElement | null = document.getElementById("dogFarmCount"); +const farmCountElement: HTMLElement | null = document.getElementById("farmCount"); const facCountElement: HTMLElement | null = document.getElementById("dogFacCount"); const bankCountElement: HTMLElement | null = document.getElementById("dogBankCount"); @@ -74,7 +74,7 @@ const hotdogButton: HTMLElement | null = document.getElementById("hotdogButton") const bunButton: HTMLElement | null = document.getElementById("bunButton"); const dadButton: HTMLElement | null = document.getElementById("dadButton"); const grillButton: HTMLElement | null = document.getElementById("grillButton"); -const dogFarmButton: HTMLElement | null = document.getElementById("dogFarmButton"); +const farmButton: HTMLElement | null = document.getElementById("farmButton"); const facButton: HTMLElement | null = document.getElementById("dogFacButton"); const bankButton: HTMLElement | null = document.getElementById("dogBankButton") @@ -92,6 +92,21 @@ const farmImage: HTMLImageElement | null = document.getElementById("farmImg") as const facImage: HTMLImageElement | null = document.getElementById("facImg") as HTMLImageElement const bankImage: HTMLImageElement | null = document.getElementById("bankImg") as HTMLImageElement +const save = (): void => { + const set = (key: string, value: string): void => { + localStorage.setItem(key, value) + } + + set('hotdogs', `${clickCount}`) + set('hotdogs/sec', `${passiveClicks}`) + set('bun', `${bunCount},${bunRate},${bunCost}`) + set('dad', `${dadCount},${dadRate},${dadCost}`) + set('grill', `${grillCount},${grillRate},${grillCost}`) + set('farm', `${farmCount},${farmRate},${farmCost}`) + set('factory', `${facCount},${facRate},${facCost}`) + set('bank', `${bankCount},${bankRate},${bankCost}`) +} + const checkBuyables = () => { if (clickCount >= bunCost) { bunImage.src = bunBuyable @@ -126,7 +141,7 @@ const checkBuyables = () => { bankImage.src = bankUnBuyable return } - if (clickCount >= dogFarmCost) { + if (clickCount >= farmCost) { farmImage.src = farmBuyable } else { console.log("Cant buy farm; therefore, cant buy anything more expensive than grill.") @@ -210,17 +225,17 @@ grillButton?.addEventListener("click", function() { grill?.play(); } }); -dogFarmButton?.addEventListener("click", function() { - if (clickCount >= dogFarmCost && farmPriceElement != null && clickCountElement != null && dogFarmCountElement != null && passiveClicksElement != null) { - clickCount -= dogFarmCost; - dogFarmCost *= increment; +farmButton?.addEventListener("click", function() { + if (clickCount >= farmCost && farmPriceElement != null && clickCountElement != null && farmCountElement != null && passiveClicksElement != null) { + clickCount -= farmCost; + farmCost *= increment; checkBuyables(); farmImage.src = farmBuying - farmPriceElement.textContent = String(dogFarmCost.toFixed(1)); + farmPriceElement.textContent = String(farmCost.toFixed(1)); clickCountElement.textContent = String(clickCount.toFixed(1)); - dogFarmCount++; - dogFarmCountElement.textContent = String(dogFarmCount); - passiveClicks += dogFarmRate; + farmCount++; + farmCountElement.textContent = String(farmCount); + passiveClicks += farmRate; passiveClicksElement.textContent = passiveClicks.toFixed(1); farm?.play(); } @@ -303,5 +318,6 @@ setInterval(function() { clickCount += passiveClicks; clickCountElement.textContent = clickCount.toFixed(1); checkBuyables(); + save() } }, 1000); diff --git a/buildings.js b/dist/buildings.js similarity index 63% rename from buildings.js rename to dist/buildings.js index 569538c..13e5778 100644 --- a/buildings.js +++ b/dist/buildings.js @@ -1,78 +1,92 @@ -var grill = new Audio("designed-fire-winds-swoosh-04-116788.mp3"); -var bun = new Audio("crunch-crispy-breadbun-41340.mp3"); -var dad = new Audio("dad-says-yummy-113126.mp3"); -var farm = new Audio("zapsplat_impacts_hit_loose_ground_dirt_impact_collapse_fall_013_102682.mp3"); -var factory = new Audio("some-kind-of-machine-103152.mp3"); -var bank = new Audio("cash-register-purchase-87313.mp3"); -var ambience = new Audio("./Hotdog-Clicker-Ambience.m4a"); +"use strict"; +const grill = new Audio("designed-fire-winds-swoosh-04-116788.mp3"); +const bun = new Audio("crunch-crispy-breadbun-41340.mp3"); +const dad = new Audio("dad-says-yummy-113126.mp3"); +const farm = new Audio("zapsplat_impacts_hit_loose_ground_dirt_impact_collapse_fall_013_102682.mp3"); +const factory = new Audio("some-kind-of-machine-103152.mp3"); +const bank = new Audio("cash-register-purchase-87313.mp3"); +const ambience = new Audio("./Hotdog-Clicker-Ambience.m4a"); ambience.loop = true; -var bunBuyable = "./Can-Buy-Bun-Button.svg"; -var bunUnBuyable = "./Cant-Buy-Bun-Button.svg"; -var bunBuying = "./Buying-Bun-Button.svg"; -var dadBuyable = "./Can-Buy-Dad-Button.svg"; -var dadUnBuyable = "./Cant-Buy-Dad-Button.svg"; -var dadBuying = "./Buying-Dad-Button.svg"; -var grillBuyable = "./Can-Buy-Grill-Button.svg"; -var grillUnBuyable = "./Cant-Buy-Grill-Button.svg"; -var grillBuying = "./Buying-Grill-Button.svg"; -var farmBuyable = "./Can-Buy-Farm-Button.svg"; -var farmUnBuyable = "./Cant-Buy-Farm-Button.svg"; -var farmBuying = "./Buying-Farm-Button.svg"; -var facBuyable = "./Can-Buy-Fac-Button.svg"; -var facUnBuyable = "./Cant-Buy-Fac-Button.svg"; -var facBuying = "./Buying-Fac-Button.svg"; -var bankBuyable = "./Can-Buy-Bank-Button.svg"; -var bankUnBuyable = "./Cant-Buy-Bank-Button.svg"; -var bankBuying = "./Buying-Bank-Button.svg"; -var passiveClicks = 0; -var clickCount = 0; -var bunCount = 0; -var dadCount = 0; -var grillCount = 0; -var dogFarmCount = 0; -var facCount = 0; -var bankCount = 0; -var bunCost = 10; -var bunRate = 0.2; -var dadCost = 100; -var dadRate = 2; -var grillCost = 500; -var grillRate = 10; -var dogFarmCost = 5000; -var dogFarmRate = 50; -var facCost = 50000; -var facRate = 500; -var bankCost = 250000; -var bankRate = 2500; -var increment = 1.3; -var passiveClicksElement = document.getElementById("passive"); -var clickCountElement = document.getElementById("clickCount"); -var grillCountElement = document.getElementById("grillCount"); -var bunCountElement = document.getElementById("bunCount"); -var dadCountElement = document.getElementById("dadCount"); -var dogFarmCountElement = document.getElementById("dogFarmCount"); -var facCountElement = document.getElementById("dogFacCount"); -var bankCountElement = document.getElementById("dogBankCount"); -var hotdogButton = document.getElementById("hotdogButton"); -var bunButton = document.getElementById("bunButton"); -var dadButton = document.getElementById("dadButton"); -var grillButton = document.getElementById("grillButton"); -var dogFarmButton = document.getElementById("dogFarmButton"); -var facButton = document.getElementById("dogFacButton"); -var bankButton = document.getElementById("dogBankButton"); -var bunPriceElement = document.getElementById("bunPrice"); -var dadPriceElement = document.getElementById("dadPrice"); -var grillPriceElement = document.getElementById("grillPrice"); -var farmPriceElement = document.getElementById("farmPrice"); -var facPriceElement = document.getElementById("facPrice"); -var bankPriceElement = document.getElementById("bankPrice"); -var bunImage = document.getElementById("bunImg"); -var dadImage = document.getElementById("dadImg"); -var grillImage = document.getElementById("grillImg"); -var farmImage = document.getElementById("farmImg"); -var facImage = document.getElementById("facImg"); -var bankImage = document.getElementById("bankImg"); -var checkBuyables = function () { +const bunBuyable = "./Can-Buy-Bun-Button.svg"; +const bunUnBuyable = "./Cant-Buy-Bun-Button.svg"; +const bunBuying = "./Buying-Bun-Button.svg"; +const dadBuyable = "./Can-Buy-Dad-Button.svg"; +const dadUnBuyable = "./Cant-Buy-Dad-Button.svg"; +const dadBuying = "./Buying-Dad-Button.svg"; +const grillBuyable = "./Can-Buy-Grill-Button.svg"; +const grillUnBuyable = "./Cant-Buy-Grill-Button.svg"; +const grillBuying = "./Buying-Grill-Button.svg"; +const farmBuyable = "./Can-Buy-Farm-Button.svg"; +const farmUnBuyable = "./Cant-Buy-Farm-Button.svg"; +const farmBuying = "./Buying-Farm-Button.svg"; +const facBuyable = "./Can-Buy-Fac-Button.svg"; +const facUnBuyable = "./Cant-Buy-Fac-Button.svg"; +const facBuying = "./Buying-Fac-Button.svg"; +const bankBuyable = "./Can-Buy-Bank-Button.svg"; +const bankUnBuyable = "./Cant-Buy-Bank-Button.svg"; +const bankBuying = "./Buying-Bank-Button.svg"; +let passiveClicks = 0; +let clickCount = 0; +let bunCount = 0; +let dadCount = 0; +let grillCount = 0; +let farmCount = 0; +let facCount = 0; +let bankCount = 0; +let bunCost = 10; +let bunRate = 0.2; +let dadCost = 100; +let dadRate = 2; +let grillCost = 500; +let grillRate = 10; +let farmCost = 5000; +let farmRate = 50; +let facCost = 50000; +let facRate = 500; +let bankCost = 250000; +let bankRate = 2500; +const increment = 1.3; +const passiveClicksElement = document.getElementById("passive"); +const clickCountElement = document.getElementById("clickCount"); +const grillCountElement = document.getElementById("grillCount"); +const bunCountElement = document.getElementById("bunCount"); +const dadCountElement = document.getElementById("dadCount"); +const farmCountElement = document.getElementById("farmCount"); +const facCountElement = document.getElementById("dogFacCount"); +const bankCountElement = document.getElementById("dogBankCount"); +const hotdogButton = document.getElementById("hotdogButton"); +const bunButton = document.getElementById("bunButton"); +const dadButton = document.getElementById("dadButton"); +const grillButton = document.getElementById("grillButton"); +const farmButton = document.getElementById("farmButton"); +const facButton = document.getElementById("dogFacButton"); +const bankButton = document.getElementById("dogBankButton"); +const bunPriceElement = document.getElementById("bunPrice"); +const dadPriceElement = document.getElementById("dadPrice"); +const grillPriceElement = document.getElementById("grillPrice"); +const farmPriceElement = document.getElementById("farmPrice"); +const facPriceElement = document.getElementById("facPrice"); +const bankPriceElement = document.getElementById("bankPrice"); +const bunImage = document.getElementById("bunImg"); +const dadImage = document.getElementById("dadImg"); +const grillImage = document.getElementById("grillImg"); +const farmImage = document.getElementById("farmImg"); +const facImage = document.getElementById("facImg"); +const bankImage = document.getElementById("bankImg"); +const save = () => { + const set = (key, value) => { + localStorage.setItem(key, value); + }; + set('hotdogs', `${clickCount}`); + set('hotdogs/sec', `${passiveClicks}`); + set('bun', `${bunCount},${bunRate},${bunCost}`); + set('dad', `${dadCount},${dadRate},${dadCost}`); + set('grill', `${grillCount},${grillRate},${grillCost}`); + set('farm', `${farmCount},${farmRate},${farmCost}`); + set('factory', `${facCount},${facRate},${facCost}`); + set('bank', `${bankCount},${bankRate},${bankCost}`); +}; +const checkBuyables = () => { if (clickCount >= bunCost) { bunImage.src = bunBuyable; } @@ -109,7 +123,7 @@ var checkBuyables = function () { bankImage.src = bankUnBuyable; return; } - if (clickCount >= dogFarmCost) { + if (clickCount >= farmCost) { farmImage.src = farmBuyable; } else { @@ -195,17 +209,17 @@ grillButton === null || grillButton === void 0 ? void 0 : grillButton.addEventLi grill === null || grill === void 0 ? void 0 : grill.play(); } }); -dogFarmButton === null || dogFarmButton === void 0 ? void 0 : dogFarmButton.addEventListener("click", function () { - if (clickCount >= dogFarmCost && farmPriceElement != null && clickCountElement != null && dogFarmCountElement != null && passiveClicksElement != null) { - clickCount -= dogFarmCost; - dogFarmCost *= increment; +farmButton === null || farmButton === void 0 ? void 0 : farmButton.addEventListener("click", function () { + if (clickCount >= farmCost && farmPriceElement != null && clickCountElement != null && farmCountElement != null && passiveClicksElement != null) { + clickCount -= farmCost; + farmCost *= increment; checkBuyables(); farmImage.src = farmBuying; - farmPriceElement.textContent = String(dogFarmCost.toFixed(1)); + farmPriceElement.textContent = String(farmCost.toFixed(1)); clickCountElement.textContent = String(clickCount.toFixed(1)); - dogFarmCount++; - dogFarmCountElement.textContent = String(dogFarmCount); - passiveClicks += dogFarmRate; + farmCount++; + farmCountElement.textContent = String(farmCount); + passiveClicks += farmRate; passiveClicksElement.textContent = passiveClicks.toFixed(1); farm === null || farm === void 0 ? void 0 : farm.play(); } @@ -241,12 +255,12 @@ bankButton === null || bankButton === void 0 ? void 0 : bankButton.addEventListe } }); // Upgrades -var mustardCost = 5000; -var tSauceCost = 1000; -var crispCost = 5000; -var tSauceButton = document.getElementById("tSauceButton"); -var mustardButton = document.getElementById("mustardButton"); -var crispButton = document.getElementById("crispButton"); +const mustardCost = 5000; +const tSauceCost = 1000; +const crispCost = 5000; +const tSauceButton = document.getElementById("tSauceButton"); +const mustardButton = document.getElementById("mustardButton"); +const crispButton = document.getElementById("crispButton"); tSauceButton === null || tSauceButton === void 0 ? void 0 : tSauceButton.addEventListener("click", function () { if (clickCount >= tSauceCost && clickCountElement != null && passiveClicksElement != null) { clickCount -= tSauceCost; @@ -281,5 +295,6 @@ setInterval(function () { clickCount += passiveClicks; clickCountElement.textContent = clickCount.toFixed(1); checkBuyables(); + save(); } }, 1000); diff --git a/index.html b/index.html index 506d7aa..21395b3 100644 --- a/index.html +++ b/index.html @@ -63,6 +63,6 @@

Hotdog Clicker

- + diff --git a/new.coffee b/new.coffee deleted file mode 100644 index 5e4996b..0000000 --- a/new.coffee +++ /dev/null @@ -1,290 +0,0 @@ -grill = new Audio 'designed-fire-winds-swoosh-04-116788.mp3' -bun = new Audio 'crunch-crispy-breadbun-41340.mp3' -dad = new Audio 'dad-says-yummy-113126.mp3' -farm = new Audio 'zapsplat_impacts_hit_loose_ground_dirt_impact_collapse_fall_013_102682.mp3' -factory = new Audio 'some-kind-of-machine-103152.mp3' -bank = new Audio 'cash-register-purchase-87313.mp3' -ambience = new Audio 'https://kotlinc.github.io/hotdog-clicker/Hotdog-Clicker-Ambience.m4a' -ambience.loop = true - -bunBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Bun-Button.svg' -bunUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Bun-Button.svg' -bunBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Bun-Button.svg' - -dadBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Dad-Button.svg' -dadUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Dad-Button.svg' -dadBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Dad-Button.svg' - -grillBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Grill-Button.svg' -grillUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Grill-Button.svg' -grillBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Grill-Button.svg' - -farmBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Farm-Button.svg' -farmUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Farm-Button.svg' -farmBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Farm-Button.svg' - -facBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Fac-Button.svg' -facUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Fac-Button.svg' -facBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Fac-Button.svg' - -bankBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Bank-Button.svg' -bankUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Bank-Button.svg' -bankBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Bank-Button.svg' - -passiveClicks = 0 -clickCount = 0 -bunCount = 0 -dadCount = 0 -grillCount = 0 -dogFarmCount = 0 -facCount = 0 -bankCount = 0 - -bunCost = 10 -bunRate = 0.2 - -dadCost = 100 -dadRate = 2 - -grillCost = 500 -grillRate = 10 - -dogFarmCost = 5000 -dogFarmRate = 50 - -facCost = 50000 -facRate = 500 - -bankCost = 250000 -bankRate = 2500 - -increment = 1.3 - -passiveClicksElement = document.getElementById'passive' -clickCountElement = document.getElementById'clickCount' - -grillCountElement = document.getElementById'grillCount' -bunCountElement = document.getElementById'bunCount' -dadCountElement = document.getElementById'dadCount' -dogFarmCountElement = document.getElementById'dogFarmCount' -facCountElement = document.getElementById'dogFacCount' -bankCountElement = document.getElementById'dogBankCount' - -hotdogButton = document.getElementById'hotdogButton' -bunButton = document.getElementById'bunButton' -dadButton = document.getElementById'dadButton' -grillButton = document.getElementById'grillButton' -dogFarmButton = document.getElementById'dogFarmButton' -facButton = document.getElementById'dogFacButton' -bankButton = document.getElementById'dogBankButton' - -bunPriceElement = document.getElementById 'bunPrice' -dadPriceElement = document.getElementById 'dadPrice' -grillPriceElement = document.getElementById 'grillPrice' -farmPriceElement = document.getElementById 'farmPrice' -facPriceElement = document.getElementById 'facPrice' -bankPriceElement = document.getElementById 'bankPrice' - -bunImage = document.getElementById 'bunImg' -dadImage = document.getElementById 'dadImg' -grillImage = document.getElementById 'grillImg' -farmImage = document.getElementById 'farmImg' -facImage = document.getElementById 'facImg' -bankImage = document.getElementById 'bankImg' - -checkBuyables = () -> - if clickCount >= bunCost - bunImage?.src = bunBuyable - else - bunImage?.src = bunUnBuyable - dadImage?.src = dadUnBuyable - grillImage?.src = grillUnBuyable - farmImage?.src = farmUnBuyable - facImage?.src = facUnBuyable - bankImage?.src = bankUnBuyable - return - if clickCount >= dadCost - dadImage?.src = dadBuyable - else - dadImage?.src = dadUnBuyable - grillImage?.src = grillUnBuyable - farmImage?.src = farmUnBuyable - facImage?.src = facUnBuyable - bankImage?.src = bankUnBuyable - return - - if clickCount >= grillCost - grillImage?.src = grillBuyable - else - grillImage?.src = grillUnBuyable - farmImage?.src = farmUnBuyable - facImage?.src = facUnBuyable - bankImage?.src = bankUnBuyable - return - - if clickCount >= dogFarmCost - farmImage?.src = farmBuyable - else - farmImage?.src = farmUnBuyable - facImage?.src = facUnBuyable - bankImage?.src = bankUnBuyable - return - - if clickCount >= facCost - facImage?.src = facBuyable - else - facImage?.src = facUnBuyable - bankImage?.src = bankUnBuyable - return - if clickCount >= bankCost - bankImage?.src = bankBuyable - else - bankImage?.src = bankUnBuyable - return - -hotdogButton?.addEventListener 'click', () -> - clickCount++ - clickCountElement?.textContent = clickCount.toFixed 1 - checkBuyables() - - - -bunButton?.addEventListener 'click', () -> - if clickCount >= bunCost - clickCount -= bunCost - bunCost *= increment - checkBuyables() - bunImage?.src = bunBuying - bunPriceElement?.textContent = bunCost.toFixed 1 - clickCountElement?.textContent = clickCount.toFixed 1 - bunCount++ - bunCountElement?.textContent = bunCount - passiveClicks += bunRate - passiveClicksElement?.textContent = passiveClicks.toFixed 1 - bun?.play() - - -dadButton?.addEventListener 'click', () -> - if clickCount >= dadCost - clickCount -= dadCost - dadCost *= increment - checkBuyables() - dadImage?.src = dadBuying - dadPriceElement?.textContent = dadCost.toFixed 1 - clickCountElement?.textContent = clickCount.toFixed 1 - dadCount++ - dadCountElement?.textContent = dadCount - passiveClicks += dadRate - passiveClicksElement?.textContent = passiveClicks.toFixed 1 - dad?.play() - - -grillButton?.addEventListener 'click', () -> - if clickCount >= grillCost - clickCount -= grillCost - grillCost *= increment - checkBuyables() - grillImage?.src = grillBuying - grillPriceElement?.textContent = grillCost.toFixed 1 - clickCountElement?.textContent = clickCount.toFixed 1 - grillCount++ - grillCountElement?.textContent = grillCount - passiveClicks += grillRate - passiveClicksElement?.textContent = passiveClicks.toFixed 1 - grill?.play() - - -dogFarmButton?.addEventListener 'click', () -> - if clickCount >= dogFarmCost - clickCount -= dogFarmCost - dogFarmCost *= increment - checkBuyables() - farmImage?.src = farmBuying - farmPriceElement?.textContent = dogFarmCost.toFixed 1 - clickCountElement?.textContent = clickCount.toFixed 1 - dogFarmCount++ - dogFarmCountElement?.textContent = dogFarmCount - passiveClicks += dogFarmRate - passiveClicksElement?.textContent = passiveClicks.toFixed 1 - farm?.play() - - -facButton?.addEventListener 'click', () -> - if clickCount >= facCost - clickCount -= facCost - facCost *= increment - checkBuyables() - facImage?.src = facBuying - facPriceElement?.textContent = facCost.toFixed 1 - clickCountElement?.textContent = clickCount.toFixed 1 - facCount++ - facCountElement?.textContent = facCount.toFixed 1 - passiveClicks += facRate - passiveClicksElement?.textContent = passiveClicks.toFixed 1 - factory?.play() - - -bankButton?.addEventListener 'click', () -> - if clickCount >= bankCost - clickCount -= bankCost - bankCost *= increment - checkBuyables() - bankImage?.src = bankBuying - bankPriceElement?.textContent = bankCost.toFixed 1 - clickCountElement?.textContent = clickCount.toFixed 1 - bankCount++ - bankCountElement?.textContent = bankCount.toFixed 1 - passiveClicks += bankRate - passiveClicksElement?.textContent = passiveClicks.toFixed 1 - bank?.play() - - - -# Upgrades - -mustardCost = 5000 -tSauceCost = 1000 -crispCost = 5000 - -tSauceButton = document.getElementById 'tSauceButton' -mustardButton = document.getElementById 'mustardButton' -crispButton = document.getElementById 'crispButton' - -tSauceButton?.addEventListener 'click', () -> - if clickCount >= tSauceCost - clickCount -= tSauceCost - checkBuyables() - clickCountElement?.textContent = clickCount.toFixed 1 - tSauceButton?.style.display = 'none' - passiveClicks += 25 - passiveClicksElement?.textContent = passiveClicks.toFixed 1 - - - -mustardButton?.addEventListener 'click', () -> - if clickCount >= mustardCost - clickCount -= mustardCost - checkBuyables() - clickCountElement?.textContent = clickCount.toFixed 1 - mustardButton?.style.display = 'none' - passiveClicks += 50 - passiveClicksElement?.textContent = passiveClicks.toFixed 1 - - - -crispButton?.addEventListener 'click', () -> - if clickCount >= crispCost - clickCount -= crispCost - checkBuyables() - clickCountElement?.textContent = clickCount.toFixed 1 - crispButton?.style.display = 'none' - bunRate *= 2 - - - -setInterval () -> - clickCount += passiveClicks - clickCountElement?.textContent = clickCount.toFixed 1 - checkBuyables() - -, 1000 \ No newline at end of file diff --git a/new.js b/new.js deleted file mode 100644 index 77e6eed..0000000 --- a/new.js +++ /dev/null @@ -1,505 +0,0 @@ -// Generated by CoffeeScript 2.7.0 -var ambience, bank, bankButton, bankBuyable, bankBuying, bankCost, bankCount, bankCountElement, bankImage, bankPriceElement, bankRate, bankUnBuyable, bun, bunButton, bunBuyable, bunBuying, bunCost, bunCount, bunCountElement, bunImage, bunPriceElement, bunRate, bunUnBuyable, checkBuyables, clickCount, clickCountElement, crispButton, crispCost, dad, dadButton, dadBuyable, dadBuying, dadCost, dadCount, dadCountElement, dadImage, dadPriceElement, dadRate, dadUnBuyable, dogFarmButton, dogFarmCost, dogFarmCount, dogFarmCountElement, dogFarmRate, facButton, facBuyable, facBuying, facCost, facCount, facCountElement, facImage, facPriceElement, facRate, facUnBuyable, factory, farm, farmBuyable, farmBuying, farmImage, farmPriceElement, farmUnBuyable, grill, grillButton, grillBuyable, grillBuying, grillCost, grillCount, grillCountElement, grillImage, grillPriceElement, grillRate, grillUnBuyable, hotdogButton, increment, mustardButton, mustardCost, passiveClicks, passiveClicksElement, tSauceButton, tSauceCost; - -grill = new Audio('designed-fire-winds-swoosh-04-116788.mp3'); - -bun = new Audio('crunch-crispy-breadbun-41340.mp3'); - -dad = new Audio('dad-says-yummy-113126.mp3'); - -farm = new Audio('zapsplat_impacts_hit_loose_ground_dirt_impact_collapse_fall_013_102682.mp3'); - -factory = new Audio('some-kind-of-machine-103152.mp3'); - -bank = new Audio('cash-register-purchase-87313.mp3'); - -ambience = new Audio('https://kotlinc.github.io/hotdog-clicker/Hotdog-Clicker-Ambience.m4a'); - -ambience.loop = true; - -bunBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Bun-Button.svg'; - -bunUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Bun-Button.svg'; - -bunBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Bun-Button.svg'; - -dadBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Dad-Button.svg'; - -dadUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Dad-Button.svg'; - -dadBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Dad-Button.svg'; - -grillBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Grill-Button.svg'; - -grillUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Grill-Button.svg'; - -grillBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Grill-Button.svg'; - -farmBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Farm-Button.svg'; - -farmUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Farm-Button.svg'; - -farmBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Farm-Button.svg'; - -facBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Fac-Button.svg'; - -facUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Fac-Button.svg'; - -facBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Fac-Button.svg'; - -bankBuyable = 'https://kotlinc.github.io/hotdog-clicker/Can-Buy-Bank-Button.svg'; - -bankUnBuyable = 'https://kotlinc.github.io/hotdog-clicker/Cant-Buy-Bank-Button.svg'; - -bankBuying = 'https://kotlinc.github.io/hotdog-clicker/Buying-Bank-Button.svg'; - -passiveClicks = 0; - -clickCount = 0; - -bunCount = 0; - -dadCount = 0; - -grillCount = 0; - -dogFarmCount = 0; - -facCount = 0; - -bankCount = 0; - -bunCost = 10; - -bunRate = 0.2; - -dadCost = 100; - -dadRate = 2; - -grillCost = 500; - -grillRate = 10; - -dogFarmCost = 5000; - -dogFarmRate = 50; - -facCost = 50000; - -facRate = 500; - -bankCost = 250000; - -bankRate = 2500; - -increment = 1.3; - -passiveClicksElement = document.getElementById`passive`; - -clickCountElement = document.getElementById`clickCount`; - -grillCountElement = document.getElementById`grillCount`; - -bunCountElement = document.getElementById`bunCount`; - -dadCountElement = document.getElementById`dadCount`; - -dogFarmCountElement = document.getElementById`dogFarmCount`; - -facCountElement = document.getElementById`dogFacCount`; - -bankCountElement = document.getElementById`dogBankCount`; - -hotdogButton = document.getElementById`hotdogButton`; - -bunButton = document.getElementById`bunButton`; - -dadButton = document.getElementById`dadButton`; - -grillButton = document.getElementById`grillButton`; - -dogFarmButton = document.getElementById`dogFarmButton`; - -facButton = document.getElementById`dogFacButton`; - -bankButton = document.getElementById`dogBankButton`; - -bunPriceElement = document.getElementById('bunPrice'); - -dadPriceElement = document.getElementById('dadPrice'); - -grillPriceElement = document.getElementById('grillPrice'); - -farmPriceElement = document.getElementById('farmPrice'); - -facPriceElement = document.getElementById('facPrice'); - -bankPriceElement = document.getElementById('bankPrice'); - -bunImage = document.getElementById('bunImg'); - -dadImage = document.getElementById('dadImg'); - -grillImage = document.getElementById('grillImg'); - -farmImage = document.getElementById('farmImg'); - -facImage = document.getElementById('facImg'); - -bankImage = document.getElementById('bankImg'); - -checkBuyables = function() { - if (clickCount >= bunCost) { - if (bunImage != null) { - bunImage.src = bunBuyable; - } - } else { - if (bunImage != null) { - bunImage.src = bunUnBuyable; - } - if (dadImage != null) { - dadImage.src = dadUnBuyable; - } - if (grillImage != null) { - grillImage.src = grillUnBuyable; - } - if (farmImage != null) { - farmImage.src = farmUnBuyable; - } - if (facImage != null) { - facImage.src = facUnBuyable; - } - if (bankImage != null) { - bankImage.src = bankUnBuyable; - } - return; - } - if (clickCount >= dadCost) { - if (dadImage != null) { - dadImage.src = dadBuyable; - } - } else { - if (dadImage != null) { - dadImage.src = dadUnBuyable; - } - if (grillImage != null) { - grillImage.src = grillUnBuyable; - } - if (farmImage != null) { - farmImage.src = farmUnBuyable; - } - if (facImage != null) { - facImage.src = facUnBuyable; - } - if (bankImage != null) { - bankImage.src = bankUnBuyable; - } - return; - } - if (clickCount >= grillCost) { - if (grillImage != null) { - grillImage.src = grillBuyable; - } - } else { - if (grillImage != null) { - grillImage.src = grillUnBuyable; - } - if (farmImage != null) { - farmImage.src = farmUnBuyable; - } - if (facImage != null) { - facImage.src = facUnBuyable; - } - if (bankImage != null) { - bankImage.src = bankUnBuyable; - } - return; - } - if (clickCount >= dogFarmCost) { - if (farmImage != null) { - farmImage.src = farmBuyable; - } - } else { - if (farmImage != null) { - farmImage.src = farmUnBuyable; - } - if (facImage != null) { - facImage.src = facUnBuyable; - } - if (bankImage != null) { - bankImage.src = bankUnBuyable; - } - return; - } - if (clickCount >= facCost) { - if (facImage != null) { - facImage.src = facBuyable; - } - } else { - if (facImage != null) { - facImage.src = facUnBuyable; - } - if (bankImage != null) { - bankImage.src = bankUnBuyable; - } - return; - } - if (clickCount >= bankCost) { - return bankImage != null ? bankImage.src = bankBuyable : void 0; - } else { - if (bankImage != null) { - bankImage.src = bankUnBuyable; - } - } -}; - -if (hotdogButton != null) { - hotdogButton.addEventListener('click', function() { - clickCount++; - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - return checkBuyables(); - }); -} - -if (bunButton != null) { - bunButton.addEventListener('click', function() { - if (clickCount >= bunCost) { - clickCount -= bunCost; - bunCost *= increment; - checkBuyables(); - if (bunImage != null) { - bunImage.src = bunBuying; - } - if (bunPriceElement != null) { - bunPriceElement.textContent = bunCost.toFixed(1); - } - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - bunCount++; - if (bunCountElement != null) { - bunCountElement.textContent = bunCount; - } - passiveClicks += bunRate; - if (passiveClicksElement != null) { - passiveClicksElement.textContent = passiveClicks.toFixed(1); - } - return bun != null ? bun.play() : void 0; - } - }); -} - -if (dadButton != null) { - dadButton.addEventListener('click', function() { - if (clickCount >= dadCost) { - clickCount -= dadCost; - dadCost *= increment; - checkBuyables(); - if (dadImage != null) { - dadImage.src = dadBuying; - } - if (dadPriceElement != null) { - dadPriceElement.textContent = dadCost.toFixed(1); - } - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - dadCount++; - if (dadCountElement != null) { - dadCountElement.textContent = dadCount; - } - passiveClicks += dadRate; - if (passiveClicksElement != null) { - passiveClicksElement.textContent = passiveClicks.toFixed(1); - } - return dad != null ? dad.play() : void 0; - } - }); -} - -if (grillButton != null) { - grillButton.addEventListener('click', function() { - if (clickCount >= grillCost) { - clickCount -= grillCost; - grillCost *= increment; - checkBuyables(); - if (grillImage != null) { - grillImage.src = grillBuying; - } - if (grillPriceElement != null) { - grillPriceElement.textContent = grillCost.toFixed(1); - } - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - grillCount++; - if (grillCountElement != null) { - grillCountElement.textContent = grillCount; - } - passiveClicks += grillRate; - if (passiveClicksElement != null) { - passiveClicksElement.textContent = passiveClicks.toFixed(1); - } - return grill != null ? grill.play() : void 0; - } - }); -} - -if (dogFarmButton != null) { - dogFarmButton.addEventListener('click', function() { - if (clickCount >= dogFarmCost) { - clickCount -= dogFarmCost; - dogFarmCost *= increment; - checkBuyables(); - if (farmImage != null) { - farmImage.src = farmBuying; - } - if (farmPriceElement != null) { - farmPriceElement.textContent = dogFarmCost.toFixed(1); - } - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - dogFarmCount++; - if (dogFarmCountElement != null) { - dogFarmCountElement.textContent = dogFarmCount; - } - passiveClicks += dogFarmRate; - if (passiveClicksElement != null) { - passiveClicksElement.textContent = passiveClicks.toFixed(1); - } - return farm != null ? farm.play() : void 0; - } - }); -} - -if (facButton != null) { - facButton.addEventListener('click', function() { - if (clickCount >= facCost) { - clickCount -= facCost; - facCost *= increment; - checkBuyables(); - if (facImage != null) { - facImage.src = facBuying; - } - if (facPriceElement != null) { - facPriceElement.textContent = facCost.toFixed(1); - } - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - facCount++; - if (facCountElement != null) { - facCountElement.textContent = facCount.toFixed(1); - } - passiveClicks += facRate; - if (passiveClicksElement != null) { - passiveClicksElement.textContent = passiveClicks.toFixed(1); - } - return factory != null ? factory.play() : void 0; - } - }); -} - -if (bankButton != null) { - bankButton.addEventListener('click', function() { - if (clickCount >= bankCost) { - clickCount -= bankCost; - bankCost *= increment; - checkBuyables(); - if (bankImage != null) { - bankImage.src = bankBuying; - } - if (bankPriceElement != null) { - bankPriceElement.textContent = bankCost.toFixed(1); - } - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - bankCount++; - if (bankCountElement != null) { - bankCountElement.textContent = bankCount.toFixed(1); - } - passiveClicks += bankRate; - if (passiveClicksElement != null) { - passiveClicksElement.textContent = passiveClicks.toFixed(1); - } - return bank != null ? bank.play() : void 0; - } - }); -} - - -// Upgrades -mustardCost = 5000; - -tSauceCost = 1000; - -crispCost = 5000; - -tSauceButton = document.getElementById('tSauceButton'); - -mustardButton = document.getElementById('mustardButton'); - -crispButton = document.getElementById('crispButton'); - -if (tSauceButton != null) { - tSauceButton.addEventListener('click', function() { - if (clickCount >= tSauceCost) { - clickCount -= tSauceCost; - checkBuyables(); - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - if (tSauceButton != null) { - tSauceButton.style.display = 'none'; - } - passiveClicks += 25; - return passiveClicksElement != null ? passiveClicksElement.textContent = passiveClicks.toFixed(1) : void 0; - } - }); -} - -if (mustardButton != null) { - mustardButton.addEventListener('click', function() { - if (clickCount >= mustardCost) { - clickCount -= mustardCost; - checkBuyables(); - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - if (mustardButton != null) { - mustardButton.style.display = 'none'; - } - passiveClicks += 50; - return passiveClicksElement != null ? passiveClicksElement.textContent = passiveClicks.toFixed(1) : void 0; - } - }); -} - -if (crispButton != null) { - crispButton.addEventListener('click', function() { - if (clickCount >= crispCost) { - clickCount -= crispCost; - checkBuyables(); - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - if (crispButton != null) { - crispButton.style.display = 'none'; - } - return bunRate *= 2; - } - }); -} - -setInterval(function() { - clickCount += passiveClicks; - if (clickCountElement != null) { - clickCountElement.textContent = clickCount.toFixed(1); - } - return checkBuyables(); -}, 1000); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..7b716ff --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,112 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + "outDir": "./dist", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "include": [ + "./buildings.ts" + ] +}