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