diff --git a/assets/img/sprites/dpad.png b/assets/img/sprites/dpad.png new file mode 100644 index 0000000..cc9a1f3 Binary files /dev/null and b/assets/img/sprites/dpad.png differ diff --git a/assets/script.js b/assets/script.js index a3dacc9..e789601 100644 --- a/assets/script.js +++ b/assets/script.js @@ -87,28 +87,24 @@ class Map { _listener = function (event) { var dontLoop = false; if (event.key === "h" || event.key === "a" || event.key === "ArrowLeft") { - self.playerDir = "l"; self.move("left"); } else if ( event.key === "j" || event.key === "s" || event.key === "ArrowDown" ) { - self.playerDir = "f"; self.move("down"); } else if ( event.key === "k" || event.key === "w" || event.key === "ArrowUp" ) { - self.playerDir = "b"; self.move("up"); } else if ( event.key === "l" || event.key === "d" || event.key === "ArrowRight" ) { - self.playerDir = "r"; self.move("right"); } else if (event.key === "r") { dontLoop = true; @@ -186,6 +182,15 @@ class Map { } move(direction) { + if (direction === "left") { + this.playerDir = "l"; + } else if (direction === "right") { + this.playerDir = "r"; + } else if (direction === "down") { + this.playerDir = "f"; + } else { + this.playerDir = "b"; + } g.levelMoves[this.level] += 1; g.totalMoves += 1; diff --git a/index.html b/index.html index 6148ed5..3ecbc25 100644 --- a/index.html +++ b/index.html @@ -20,6 +20,26 @@ width: 100%; } + .opts { + position: absolute; + top: 10; + right: 10; + font-size: 15px; + } + + .opts-menu { + text-align: right; + padding: 5px; + position: absolute; + top: 40; + right: 10; + font-size: 15px; + width: auto; + height: auto; + background-color: ghostwhite; + display: none; + } + #map { white-space: pre; } @@ -29,6 +49,11 @@ width: 50px; } + #dpad { + margin-top: 20px; + display: none; + } + #stats { font-size: 20px; margin-bottom: 8px; @@ -39,6 +64,12 @@ margin-bottom: -19px; } + @media (max-width: 481px) { + pre { + font-size: 17px; + } + } + a { color: black; text-decoration: none; @@ -64,9 +95,14 @@ text-decoration: none; } - +
+█▀ █▀█ █▄▀ █▀█ █▄▄ ▄▀█ █▄░█ █▄█ ▄▀█ ▄█ █▄█ █░█ █▄█ █▄█ █▀█ █░▀█ ░█░ █▀█@@ -75,6 +111,43 @@+++ +
[r]eset Arrow Keys+VIM keys [hjkl] -TODO:
--
- Mobile Support
-- Create a cool song and SFX
-- Points system
-- Steam animation when you beat a level
-- Add more level sets (worlds)
-Credits:
+
- @@ -124,7 +189,30 @@ here
UPDATES:
++ (09/07/25) v1.1: released mobile support via toggleable Dpad, see settings at top right of page! + +TODO:
++
- +
Mobile Support- Selectable levels upon completion
+- Create a cool song and SFX
+- Points system
+- Steam animation when you beat a level
+- Add more level sets (worlds)
+