Day 6 - Space Game

July 6, 2024
day6.pubstud.io
Continuing with the theme of cleaning up and publishing older code, today I will resurrect and old web game I wrote over ten years ago called Xenophobia. It’s a Galaga clone with a (buggy) level editor written in Javascript and using Canvas for graphics.
The game was posted on the previous version of my personal site, and wasn’t completely isolated from the rest of the code. I’ll have to extract it to a separate repo, add a demo page for testing, and set up a build step so it can be embedded easily in a PubStudio page.
If I have time, a minor graphics refresh would be nice to have, as well as converting the code to Typescript to help find any existing bugs.

Must Have

  • New repository using Vite to bundle the game
  • Split code from old home page
  • Fix any critical bugs

Nice To Have

  • Update code to Typescript
  • Improve graphics
  • Split engine code into a separate package

Conclusion

https://day6.pubstud.io
It took a while to clean everything up, partly because I ended up deciding to convert everything to Typescript. I figured it would help fix any bugs, and would make it easier to maintain in the future. Overall everything went well, the code is published at @sampullman/simple-game-engine.
A few bugs remain, but considering it was written over 10 years ago, it was surprisingly easy to get the game running again. Much more code from the game can be made reusable by moving it to the engine, but I’m happy with the result.
© 2024 Sam Pullman |
Site visits:
0