NEW PROJECT – Centipede

Category: | Posted on:February 13, 2025

Centipede is a bare-bones facsimile of the classic arcade game of the same name.

Objective

Continuing my exploration of Game Development with the Javascript Canvas API, I moved onto Centipede mostly by accident. Once again I avoided tutorials in order to try and work through the logic myself. The key goal with this game was handling more complex nested arrays.

Development

I accidentally developed the base movement for the Centipede object while working on Space Invaders. The linked segments gliding back and forth was easier to program initially than the ticked timeout movement of the aliens.

There is an array for centipedes, with each centipede containing an array of segments, and each new centipede generating on hit by a missile. Shooting a segment causes the split segment to reverse velocity. When the segments are gone, you win.

The mushrooms are generated randomly within some min and max ranges to prevent them from spawning to close to any edges.

Hurdles

Handling the centipede split was the most challenging part of the build and it’s still a bit bugged as of writing. When a missile collides with a segment, the parent centipede splits in two new arrays of the remaining segments. Sometimes incorrect segments disappear when another one is shot, and the total segment count seems to get lost sometimes.

Related Logs


  • WIP – Machine Shop Simulator

    January 27, 2026

    Machine Shop Simulator is a prototype management sim game for the browser built with React and the HTML Canvas API. It is a facsimile of a CNC machine shop. Objectives Development 1/27/2026 – This is finally at a point where it’s shareable, even if it isn’t done. I’d call it halfway there as a proof […]

    Continue Reading
  • NEW PROJECT – Javascript Arcade

    January 14, 2026

    Javascript Arcade is a stylized hub for the JS Canvas projects I’ve been working on. Objective I’m re-working my portfolio and needed more casual project to fill it out. The individual arcade games are pretty similar structurally, so it made sense to wrap them up together into a more formalized package for presentation purposes. There;s […]

    Continue Reading
  • UPDATE – Space Invaders

    January 28, 2025

    Quick presentational update to the Space Invaders project. Keep Shields Centered On Hit Shields will now automatically maintain a centered position when hit my an alien missile. I initially thought this was going to involve some math to determine whether the missile hit on the right or left side. I even put together a formula […]

    Continue Reading