From 0c43d6d1043dfc35ab911889652353a54072d013 Mon Sep 17 00:00:00 2001 From: Yannik <80621863+vaporvee@users.noreply.github.com> Date: Fri, 23 Jun 2023 22:49:49 +0200 Subject: [PATCH] added reset button --- index.html | 1 + text_horror/app.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/index.html b/index.html index 9882761..7d4849e 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,7 @@
+Reset
Leben:
diff --git a/text_horror/app.js b/text_horror/app.js index 56718d4..c9f0101 100644 --- a/text_horror/app.js +++ b/text_horror/app.js @@ -40,6 +40,15 @@ function load(isJump = false) { nextDlg(false); //Skip to first }); } +function resetGame() { + if (confirm("Willst du wirklich deinen gesamten Fortschritt im Spiel löschen?") == true) { + localStorage.setItem("dlgPointer", "0"); + localStorage.setItem("dlgKeyMain", "main"); + localStorage.setItem("weaponDamage", "1"); + localStorage.setItem("weaponName", "Fäuste"); + location.reload(); + } +} //change current dialogue lines with dictionary keys function changeDlg(dlgKey) { if (typeof dlgFile[dlgKey] === "string") {