Compare commits
No commits in common. "4e435da82b39e2b6aeea1439b9baeed656fbf3ae" and "50fa9b0f5c6f306f9975a293c203394eefbc3a68" have entirely different histories.
4e435da82b
...
50fa9b0f5c
2 changed files with 18 additions and 32 deletions
|
@ -50,7 +50,6 @@ class Map {
|
||||||
|
|
||||||
this.totalWin = g.level + 1 == levels.length;
|
this.totalWin = g.level + 1 == levels.length;
|
||||||
this.finalPointsGiven = false;
|
this.finalPointsGiven = false;
|
||||||
this.traditional = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
generateMapArray() {
|
generateMapArray() {
|
||||||
|
@ -86,11 +85,7 @@ class Map {
|
||||||
getKeystroke() {
|
getKeystroke() {
|
||||||
var self = this;
|
var self = this;
|
||||||
_listener = function (event) {
|
_listener = function (event) {
|
||||||
if (
|
if (["Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].indexOf(event.code) > -1) {
|
||||||
["Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].indexOf(
|
|
||||||
event.code,
|
|
||||||
) > -1
|
|
||||||
) {
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
var dontLoop = false;
|
var dontLoop = false;
|
||||||
|
@ -160,26 +155,22 @@ class Map {
|
||||||
let map = "";
|
let map = "";
|
||||||
for (let i = 0; i < this.mapArray.length; i++) {
|
for (let i = 0; i < this.mapArray.length; i++) {
|
||||||
for (let j = 0; j < this.mapArray[i].length; j++) {
|
for (let j = 0; j < this.mapArray[i].length; j++) {
|
||||||
if (this.traditional) {
|
if (this.mapArray[i][j] === "#") {
|
||||||
map += this.mapArray[i][j];
|
map += '<img src="assets/img/sprites/wall.png">';
|
||||||
} else {
|
} else if (this.mapArray[i][j] === " ") {
|
||||||
if (this.mapArray[i][j] === "#") {
|
map += '<img src="assets/img/sprites/floor.png">';
|
||||||
map += '<img src="assets/img/sprites/wall.png">';
|
} else if (this.mapArray[i][j] === "0") {
|
||||||
} else if (this.mapArray[i][j] === " ") {
|
map += '<img src="assets/img/sprites/coal.png">';
|
||||||
map += '<img src="assets/img/sprites/floor.png">';
|
} else if (this.mapArray[i][j] === "*") {
|
||||||
} else if (this.mapArray[i][j] === "0") {
|
map += '<img src="assets/img/sprites/fire_coal.png">';
|
||||||
map += '<img src="assets/img/sprites/coal.png">';
|
} else if (this.mapArray[i][j] === "@") {
|
||||||
} else if (this.mapArray[i][j] === "*") {
|
if (!grillChar) {
|
||||||
map += '<img src="assets/img/sprites/fire_coal.png">';
|
map += `<img src="assets/img/sprites/char${this.playerDir}.png">`;
|
||||||
} else if (this.mapArray[i][j] === "@") {
|
} else {
|
||||||
if (!grillChar) {
|
map += `<img src="assets/img/sprites/grill-char${this.playerDir}.png">`;
|
||||||
map += `<img src="assets/img/sprites/char${this.playerDir}.png">`;
|
|
||||||
} else {
|
|
||||||
map += `<img src="assets/img/sprites/grill-char${this.playerDir}.png">`;
|
|
||||||
}
|
|
||||||
} else if (this.mapArray[i][j] === ".") {
|
|
||||||
map += '<img src="assets/img/sprites/grill.png">';
|
|
||||||
}
|
}
|
||||||
|
} else if (this.mapArray[i][j] === ".") {
|
||||||
|
map += '<img src="assets/img/sprites/grill.png">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
map += "<br>";
|
map += "<br>";
|
||||||
|
|
|
@ -104,12 +104,7 @@
|
||||||
<a href="#" onclick="toggleDisplay('opts-menu')">settings</a>
|
<a href="#" onclick="toggleDisplay('opts-menu')">settings</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="opts-menu" id="opts-menu">
|
<div class="opts-menu" id="opts-menu">
|
||||||
<a href="#" onclick="toggleDisplay('dpad')">toggle D-Pad</a><br />
|
<a href="#" onclick="toggleDisplay('dpad')">toggle D-Pad</a>
|
||||||
<a
|
|
||||||
href="#"
|
|
||||||
onclick="if (g.mapInstance.traditional) {g.mapInstance.traditional = false} else {g.mapInstance.traditional = true}; g.mapInstance.display()"
|
|
||||||
>toggle Graphics</a
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<center>
|
<center>
|
||||||
<pre style="margin-top: 30px">
|
<pre style="margin-top: 30px">
|
||||||
|
@ -202,7 +197,7 @@
|
||||||
<h4>UPDATES:</h4>
|
<h4>UPDATES:</h4>
|
||||||
<li>
|
<li>
|
||||||
(09/07/25) v1.1: released mobile support via toggleable Dpad, see
|
(09/07/25) v1.1: released mobile support via toggleable Dpad, see
|
||||||
settings at top right of page! Also added support for traditional graphics... also see settings.
|
settings at top right of page!
|
||||||
</li>
|
</li>
|
||||||
<h4>TODO:</h4>
|
<h4>TODO:</h4>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
Loading…
Reference in a new issue