I hereby claim:
- I am worldoptimizer on github.
- I am maxziebell (https://keybase.io/maxziebell) on keybase.
- I have a public key whose fingerprint is 3CAD 5CF1 89E1 A8C3 A5EF 23E6 B1B4 6EC2 9362 2709
To claim this, I am signing this object:
function symbolInit (hypeDocument, element, event){ | |
console.log('HypeSymbolInit'); | |
var symbolInstance = hypeDocument.getSymbolInstanceForElement(element); | |
var symbolElement = symbolInstance.element(); | |
switch (symbolInstance.symbolName()){ | |
case 'counter': | |
Object.assign( symbolInstance, { | |
_counter: 0, | |
increase: function(){ |
// fetch scene element and then the lander element in it by classname | |
var sceneElm = document.getElementById(hypeDocument.currentSceneId()); | |
var lander = sceneElm.querySelector('.lander'); | |
var landerBody = hypeDocument.getElementProperty(lander, 'physics-body'); |
var keyPressLookup = {}; | |
document.addEventListener('keydown', function(e){ | |
keyPressLookup[e.code] = true; | |
}); | |
document.addEventListener('keyup', function(e){ | |
delete keyPressLookup[e.code]; | |
}); |
I hereby claim:
To claim this, I am signing this object:
// Lower value increases trail duration. | |
const CANVAS_CLEANUP_ALPHA = 0.3; | |
// Cleans up the canvas by removing older trails. | |
// ... | |
function cleanCanvas() { | |
// Set 'destination-out' composite mode, so additional fill doesn't remove non-overlapping content. | |
context.globalCompositeOperation = 'destination-out'; | |
// Set alpha level of content to remove. | |
// Lower value means trails remain on screen longer. |