Andrzej Mazur • @end3r • Enclave Games
BBDays4IT, Bielsko-Biała, September 14th 2019
Eat, sleep, code, repeat.
<style> body { margin: 0; background: black; ... } </style>
<canvas></canvas>
<script>
document.title = "Blade Gunner";
...
</script>
Blade Gunner
var i = new Image();
i.addEventListener('load', function() { // image can be drawn });
i.src = 'data:image/png;base64,iVBORw0KGgoAAAANS...RU5ErkJggg==');
Blade Gunner
Snake.UI = {
food: [
[ ],
[ , ,1 ],
[ ,1, ,1],
[ , ,1 ]
]
};
Buggy Snake
Snake.Sound.sounds = {
// Example sound - entering the TRON mode
enterTronMode: [
jsfxr([0,,0.0864,,0.4458,0.2053,,0.3603,,,,,,0.2349,,0.4484,,,1,,,,,0.5]),
jsfxr([0,,0.2012,,0.4803,0.2939,,0.326,,,,,,0.525,,0.6112,,,1,,,,,0.5]),
jsfxr([0,,0.2424,,0.2184,0.2631,,0.2023,,,,,,0.2315,,,,,1,,,,,0.5]),
jsfxr([0,,0.0429,,0.4426,0.5,,0.2284,,,,,,0.1798,,,,,1,,,,,0.5]),
jsfxr([1,,0.2311,,0.2188,0.2821,,0.0801,,,,,,,,,,,1,,,,,0.5])
]
};
Buggy Snake
It can be a demo.
end3r.com/slides/bbdays4it-js13k