Add music

This commit is contained in:
asraelite 2018-03-07 14:23:45 +00:00
parent 194c0bf846
commit bd97945e66
14 changed files with 82 additions and 20 deletions

View file

@ -28,8 +28,9 @@ function renderParticle(particle) {
function renderEntity(entity) {
context.save();
context.translate(...entity.com);
if (graphics.perspective.zoom < 2 && graphics.markers) {
context.globalAlpha = 0.7 / graphics.perspective.zoom;
let alpha = Math.max(1 - ((graphics.perspective.zoom - 1) / 2), 0) ** 2;
if (alpha > 0 && graphics.markers) {
context.globalAlpha = alpha;
context.beginPath();
context.arc(0, 0, 4, 0, 2 * Math.PI);
context.lineWidth = 1;