Submersible Warship 2063: a JS13KGAMES 2018 postmortem

Jerome Lecomte
Feb 19 · 12 min read
Enemy submarines have entered your perimeter. Stay off their radar and fight back!

Game Ideation


Art direction

Actual Knights of Sidonia screencap. Did I rip off the style? No, I paid tribute ;p

Lessons learned

Use a build chain

Plan your music ahead

const player = new CPlayer();
player.init(/* song data */);
let loaded = 0;
while (loaded < 1) {
loaded = player.generate();
console.log(`loaded ${loaded * 100}%`);
}
let wave = player.createWave();
...

Entity-Components-Systems


What I’d do differently

Mobile first gameplay

No AI

Asset editor

Behold the One Rock’s secret formula!

Grade 9 trigonometry

areEntitiesColliding = (r1 + r1)² > (x1 - x2)² + (y1 - y2)²
// (tx, ty) is the target’s 2D position
// (sx, sy) is the source’s 2D position
// (vx, vy) is the source’s 2D velocity vector
// alpha is angle in degrees in range [-180, 180]
alpha = (((Math.atan2(ty - sy, tx – sx) – Math.atan2(vy, vx)) * (180/Math.PI) + 180) % 360) – 180
Torpedo position & velocity, and sub position in a 2D space. Alpha is the angle we’re looking for.
atan2(vel.y, vel.x) is the angle between the torpedo’s current direction and the x-axis
atan2(tar.y — src.y, tar.x — src.x) is the angle between the line passing by the torpedo and the target, and the x-axis.
The difference between these 2 angles (modulo 2PI) is the angle we’re looking for in the range [0, 2PI]

Next steps


My favourite JS13KGAMES 2018 games

Jerome Lecomte

Written by

Software engineer turned web developer and father of four, I create pixel art, video games and visual experiments on the Web.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade