Electric Froth

______ _ ______ ( / // _/_ o ( / _/_ / /-- // _ _, / _ , _, -/--_ __ / /_ (/____/(/_(/_(__(__/ (_(_(__ _/ / (_(_)(__/ /_

up

HTML+JS framework and some new (to me) js!

by Joel Kleier on 2018-04-13


Occassionally I look around at various recreational game jams to see what’s going on, and I like looking at the resource section of these game jam’s because they tend to lead me to new things I haven’t seen before!

One such thing I found was an HTML+JS game framework that fits in a tweet! A bit tongue-in-cheek, perhaps, but still held some interesting features I hadn’t really encountered in javascript — namely, template strings/literals and arrow functions.

Both are only directly supported in fairly modern browsing experiences, but are able to be supported in older browsers using babeljs or a similar tool.

Here’s the "framework" in all it’s glory:

<canvas id=a>
<script>
x=a.getContext`2d`;
screen=0;
setInterval(e=>{ /* … */ },33);
onclick=e=>{ /* … */ }
oninput=e=>{ /* … */ }
</script>