diff --git a/public/img/favicon.png b/public/img/favicon.png index ff74b33..1f887b8 100644 Binary files a/public/img/favicon.png and b/public/img/favicon.png differ diff --git a/public/img/favicon_large.png b/public/img/favicon_large.png new file mode 100644 index 0000000..b917c63 Binary files /dev/null and b/public/img/favicon_large.png differ diff --git a/public/img/main.png b/public/img/main.png new file mode 100644 index 0000000..baea3a9 Binary files /dev/null and b/public/img/main.png differ diff --git a/public/img/ships/01/hull.png b/public/img/ships/01/hull.png index a45c0f4..a46cfb5 100644 Binary files a/public/img/ships/01/hull.png and b/public/img/ships/01/hull.png differ diff --git a/public/img/ships/01/hull_old.png b/public/img/ships/01/hull_old.png new file mode 100644 index 0000000..a45c0f4 Binary files /dev/null and b/public/img/ships/01/hull_old.png differ diff --git a/public/js/wingbase/render/asteroids.js b/public/js/wingbase/render/asteroids.js index a8d79c3..12514bc 100644 --- a/public/js/wingbase/render/asteroids.js +++ b/public/js/wingbase/render/asteroids.js @@ -15,9 +15,14 @@ Renderer.prototype.renderAsteroid = (pallet, body) => { context.lineTo(points[i][0], points[i][1]); } context.closePath(); - context.strokeStyle = '#fff'; + context.clip(); context.fillStyle = body.debug ? `rgb(${body.debug}, 9, 9)` : '#090909'; context.fill(); + context.lineWidth = 7; + context.strokeStyle = '#000'; + context.stroke(); + context.lineWidth = 3; + context.strokeStyle = '#fff'; context.stroke(); pallet.restore(); diff --git a/public/js/wingbase/render/render.js b/public/js/wingbase/render/render.js index 0b161bd..68bbf8f 100644 --- a/public/js/wingbase/render/render.js +++ b/public/js/wingbase/render/render.js @@ -39,7 +39,7 @@ class Renderer { } pallet.clear(); - pallet.fill('#000'); + pallet.fill('#020202'); context.save(); @@ -49,16 +49,20 @@ class Renderer { // Grid var gridx = cx % 50; var gridy = cy % 50; + pallet.opacity(0.05); for (var x = gridx - cw / 2 - 50; x < cw + 50; x += 50) { for (var y = gridy - ch / 2 - 50; y < ch + 50; y += 50) { var wx = (-cx + x) / SCALE; var wy = (-cy + y) / SCALE; var b = game.world.bounds; - if (wx > b.right || wx < b.left || wy > b.bottom || wy < b.top) - pallet.outline('#141424', x, y, 51, 51, 1); - else pallet.outline('#0a0a0a', x, y, 51, 51, 1); + if (wx > b.right || wx < b.left || wy > b.bottom || wy < b.top) { + pallet.opacity(0.2); + pallet.outline('#8af', x, y, 51, 51, 1); + pallet.opacity(0.05); + } else pallet.outline('#fff', x, y, 51, 51, 1); } } + pallet.opacity(1); for (var id in game.world.bodies) { var body = game.world.bodies[id]; diff --git a/public/js/wingbase/world/physics.js b/public/js/wingbase/world/physics.js index 88c6050..43dfde0 100644 --- a/public/js/wingbase/world/physics.js +++ b/public/js/wingbase/world/physics.js @@ -60,7 +60,8 @@ class Physics { } removeBody(body) { - this.toRemove.push(body.b2body); + if (body) + this.toRemove.push(body.b2body); } step() { @@ -81,6 +82,7 @@ class Physics { body.b2body.SetLinearVelocity(new b2Vec2(body.xvel, body.yvel)); body.b2body.SetAngularVelocity(body.rvel); } + for (var i = 0; i < this.toRemove.length; i++) { this.world.DestroyBody(this.toRemove[i]); } diff --git a/public/js/wingbase/world/world.js b/public/js/wingbase/world/world.js index 7bebc08..86a7bd2 100644 --- a/public/js/wingbase/world/world.js +++ b/public/js/wingbase/world/world.js @@ -38,15 +38,11 @@ class World { if (data.type == 'structure') body = new Structure(data); if (data.type == 'missile') body = new Missile(data); - //if(data.type == 'ship') console.log(body); - this.bodies[body.id] = body; - //if(data.type == 'ship') console.log(this.bodies); this.physics.createBody(body); }; remove(id) { - //console.log(id); this.physics.removeBody(this.bodies[id]); delete this.bodies[id]; };