4 ms·
Honestly, feel free to do it in HTML/CSS/JS. The goal isn't to go as hard as you possibly can, simply to start realizing how much more "first class" knowledge
by taeric 3y ago
Honestly, feel free to do it in HTML/CSS/JS. The goal isn't to go as hard as you possibly can, simply to start realizing how much more "first class" knowledge of items on the screen you probably want.
One thing I will caution is to not try and lean into making DOM layout do what you want. Represent the different elements as divs that are absolutely positioned, and you can go a long way. You'll probably still want a lot of seemingly duplicated data in places that you control directly, but that is part of the point.
- o11c 3y agoI'm far from an HTML expert, but there are a few things that absolutely need to be done The HTML Way™: scrolling - both in terms of event dispatch, and in terms of sizing (incorrect absolute positioning can break this), possibly focus as well. I don't pretend to understand under what exact circumstances the spacebar works for pagedown, but it's certainly something that fails often on fancy webpages but works intuitively on simple ones. copy-paste. No, middle click is not just another way of meaning ctrl-v, I want the correct buffer dammit! rich text editing is poorly supported however you do it, but be sure to have a fallback to a plain text mode that uses the browser controls
- taeric 3y agoI mean... yes, if you are building a webpage, you should consider the capabilities of the web browser. I'd be surprised if copy/paste is something you want in your game. Scrolling for a game is again something you probably have specific ideas on. You could make it so that a side scroller builds everything so that html scrolling gets what you want. Odds are high that you'd have an easier time taking over a lot of that on your own. (Indeed, this is essentially how popular mapping "tiles" work. You don't have all tiles in the DOM, but play with the ones visible to work as desired.) And what I mean for absolute positioning is more in line with what I do in https://taeric.github.io/cube-permutations-1.html https://taeric.github.io/cube-permutations-1.html. And even there, I do not keep some things in state such that I have no control over the actual path a face travels as it moves into its new current spot.