gameplay (for fixed key stream) (workings are below)
```{ojs}viewof frame_in =Scrubber(_.range(0,900),{delay:100, autoplay:false})viewof keysmain.keys$m.cacheviz_spec =({ data:{name:'data'}, datasets:{data: viz_data0},"mark":{"type":"text","align":"left","tooltip":true}, encoding:{ x:{field:'player_x', axis:{grid:false}, type:'quantitative', scale:{domain:[-30,50]}}, y:{field:'player_y', axis:{grid:false}, type:'quantitative', scale:{domain:[-5,50]}}, size:{value:20}, text:{field:'keys_annotation', type:'nominal'},// keys_annotation includes the emoji, will fix}, height:150, width:200,})viz_data =calcuvegadata({ models:[main], spec: viz_spec, domains:{}, input_cursors:[{frame_in, keys_stream_in: keys.filter(d =>d.frame== frame_in)/*prob not using memo, but still pure, do a filter?*/, g_in, s_in, jump_limit_in}]})viz_dataviewof viz =embed(viz_spec)keys{ console.log(Object.entries(main.player_x$m.cache).length) frame_in; keys_stream_in; g_in; s_in; jump_limit_in; viz.data("data", viz_data)/*.resize()*/.run();}mutable viz_data0 =[]// includes data in spec for when I Open in Vega Editorhtl.html`<button onclick=${()=>(mutable viz_data0 = viz_data)}>insert data -> vega editor(dev)</button>`import{ fps, color } from "@ondras/fps"div ={ let node = html`<div>fps: ${Math.floor(fps)}</div>`; node.style.fontSize="1em"; node.style.color= color; node.style.textShadow="0 0 0.08em #000";return node;}```