This one is for you developers out there: Play a game inside local storage!
|Published:||Thu, March 7, 2019, 21:20|
Control your player with your arrow keys or WASD.
I've run the game successfully on Chrome 72 @ Mac + Windows 10, Firefox 65 @ Mac + Linux Mint, Firefox X @ Windows 7, Vivaldi 2.3 @ Mac and Opera 58 on Mac + Windows 10.
It does not work on Microsoft Edge 42 @ Windows 10 as their DevTools doesn't auto-refresh any of their web storages. Internet Explorer 11 (at least on Windows 7) doesn't have a proper
Are you kidding me? Because it could be done, because it's something I haven't seen before, and because programming is tons of fun. When I got the idea I had to finish it.
It is a bit annoying to play the game in Firefox's devtools as they have a (probably normally useful) feature of blinking every time the
localStorage is updated.
localStorage is so much simpler, and to my surprise all the browsers I first tested immediately updated the developer tools to show the contents of the local storage.
Yes! Just head over to my GitHub repository for the game. Please note that while my game code is licensed under MIT License, the sound and music assets have their own licenses.
I hope that you will make Tetris or a car game for the browser devtools. That would be so cool. 😀
None of the developer tools I tried used a monospaced font for the
localStorage, making it really hard to make the game at all.
Emojis might not be of the same width, but they are almost of the same width, making it easier to make the game.
Mozilla has a really nice description on how internationalize your keyboard controls so that
WASD magically becomes
ZQSD for people with
AZERTY keyboards. (Hello 🇫🇷.)
The world isn't ready for ES6. This is no surprise I suppose. I started out going all classes, fields (ok, that's TC39), arrow functions, computed property names, various String functions, etc., but had to go back to good old days to make the code run everywhere.