the only winning move is to what the fuck is going on
Nice!
Using #JSZip I can create zip archive on-the-fly 😻
Imagine a web UI allowing you to describe stuff, then download a zip of that project to get started.
Bring your runtime and start hacking it.
have you seen the finnish air force flag?
susi has told me that šuši wats pleroma friends
susi on pleroma has no friends.
And with this, I think I will wrap it up for today.
Plenty of ideas.
If you interested in something especially, let me know and I'll explain further.
(Sorry to layer8.space people for spamming the local timeline)
Plus, CSS allows me to take care for transitions and animations (something to implement in Canvas on your own or by a library).
I haven't looked into #WebXR however. Opening the respective frameworks make my fan spin. Nope. Not even trying to use them with this hardware.
I collect some minimal information like username and single or multiplayer upfront and then launch the game.
My personal niche: #SVG.
Most games are written in Canvas API with PNG tilesets and everything.
But those expose no #accessibility APIs whatsoever.
I want to look into building accessible games. SVG has <title> and <desc> to put text in.
Something I learned to value are to think of the UI as in terms of scenes. Like in a theatre.
I believe, #Phaser taught me this.
Have every view (like you might say in Android or iOS) be a scene with things to put in.
By using event listeners on document.body I can dispatch actions on the store and then have the data take care of the UI to update.
Maxime / Xem is a person to stay close to. He assembled a lot of research and code gulf, that will teach you new tricks.
The tweet also mentions to come up with a demo as soon as possible so to gather feedback by others who play it.
I try to support Desktop Firefox and Chromium as well as Android mobiles and tablets (using Firefox).
I can use this for transitions or key bindings.
Oh, and don't support #WASD only. For example, the French keyboard layout will make those players cringe.
Next to arrow keys (and on-screen buttons) #ZQSD is recommended:
https://nitter.net/MaximeEuziere/status/1558372331592056832#m
jQuery encouraged you to use #EventDelegation: register and event handler not on every element, but on some further up the tree.
So if I register with document.body, I can catch almost everything. Looking at the event.target allows me to decide what to do.
By coming up with a clever HTML API using data attributes ( https://www.smashingmagazine.com/2017/02/designing-html-apis/ ) allows me to declarative control the experience.
Betting on the frameworkless movement ( https://github.com/frameworkless-movement/manifesto ) has a drawback:
the DOM is edited quite often. Attached event listener would lead to a memory leak.
But there's a way out!
jQuery (no, hear me out!)
By using Redux I can have easy debug by offering controls, to set up the game environment in a way I want. Then I can hack to my pleasure.
Since Redux is based on JavaScript primitives, it is JSON-serialisable. I can put it into localStorage and have a save button.
I can offer Redo and Undo thanks to Actions.
I can even go so far and have the state replay over the network (multiplayer!)
According to https://stackoverflow.com/a/58804758 the naïve approach of using innerHTML won't work. JavaScript will be injected, but not executed.
Instead, applying https://stackoverflow.com/a/62641523 allows you to use a DocumentFragment, that can be inserted into the DOM and run the JavaScript.
So if I put everything into an iframe, I can have a preview next to the forms.
Now, if you call Function.prototype.toString() you can see the whole implementation as string. This will break all closures, so you might need to include more that just the public API. But FP leans towards many small functions. By using function declarations (instead of function expressions), hoisting might play into your cards.
Then, you „just” need to take care for the data separately.
If I take it a step further, I can use form inputs to accept the information, that make games special. Put them into a Store.
And generate code.
Yes, there are ways to do this proper with #AST and everything.
But hey, this is JavaScript :D
You can create functions on-the-fly, e.g. using the Function constructor.
I'm going the route of assembling a <script> on-the-fly. That is, having the code as string.
So if I have data and functions, I can build an interface.
It took https://invidious.namazso.eu/watch?v=rf0tbaSReKM to kick of the way how I want to do it. Namely the add, render and applyToDOM functions described there.
Combined with Redux, this is powerful.