added reset button
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onpageshow="load()">
|
<body onpageshow="load()">
|
||||||
|
<p onclick="resetGame()"> <u>Reset</u></p>
|
||||||
<div hidden="true" class="box" id="fight">
|
<div hidden="true" class="box" id="fight">
|
||||||
<img draggable="false" id="enemy-texture"><br>
|
<img draggable="false" id="enemy-texture"><br>
|
||||||
<p><span id="enemy-name"></span> Leben: <span id="enemy-health"></span></p>
|
<p><span id="enemy-name"></span> Leben: <span id="enemy-health"></span></p>
|
||||||
|
@@ -40,6 +40,15 @@ function load(isJump = false) {
|
|||||||
nextDlg(false); //Skip to first
|
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
|
//change current dialogue lines with dictionary keys
|
||||||
function changeDlg(dlgKey) {
|
function changeDlg(dlgKey) {
|
||||||
if (typeof dlgFile[dlgKey] === "string") {
|
if (typeof dlgFile[dlgKey] === "string") {
|
||||||
|
Reference in New Issue
Block a user