These sorts of games are incredibly fun to write in modern languages, especially if you are given a canvas and the ability to blit graphics around without much concern for memory usage or blit speed. I especially like the implementation of yours, and the code is nicely arranged and readable, and surprisingly, just a single file. The difficulty ramping could use a little tuning, it hews close to the relentless "you dead!" difficulty ramping of a 1980's console game. Maybe I've just gone soft in the intervening years. Overall, fun to play.
Obligatory self-promotion: https://justin-lloyd.com/ which is my C.V. site that includes a 1970's-era space invaders style game based on the portable Galaxy Invaders 1000 game.
"Invaders from 78" is written in Typescript, implements a small ECS framework, uses Pixi for canvas rendering, and is event driven. No audio because, well... it's a C.V. website. It also doesn't work on mobile because the audience numbers for mobile visitors to my C.V. website is near enough zero that it would be wasted effort. Please excuse any front-end sins I may have committed because I generally don't do front-end web dev.
The game is also included directly on the C.V./portfolio page, scroll down and to the right. Kind of like an Easter Egg that isn't too well hidden. The link you post I think is to a slightly older version of the game. It still works, it just might not work the same. I don't think the game at the link you posted uses the event framework. I wanted to understand how some of the Javascript event emitter frameworks worked. So there's the classic event/action invoker style, and then the event emitter style. I need to upload a newer version as well, that utilizes texture packing, effectively reducing the entire invaders game to just four files.
Thanks for making and sharing this! It’s awesome to see a dream fulfilled!
I have a lot of fun making little JavaScript games like this and recently made a way to create sprites using ASCII[0] inline with the code. I call these “pixel-character encoded images” aka PCEImages. I also made an editor web page[1] to help make this ASCII art.
I noticed your sprites are drawn as rectangles in the canvas. PCEImage could hopefully drop in pretty easily if you want to try it out!
Superfun, nice sound design. Maybe try to scale the number of bullets with number of enemies? The levels are super hard and luck-based the first 10 seconds and then drags on a bit.
How many levels did you survive? Just curious to find out how difficult the game appears to be to others. I shared this game with my colleagues, friends, and family last weekend. The maximum anyone has claimed to reach so far is level 10. The maximum I have been able to reach so far is level 8.
The player has autofire. No buttons need to be pressed. The player emits a green laser pulse automatically. As soon as one laser pulse disappears (either due to going off the canvas or due to hitting a ship or canon), the next laser pulse is emitted automatically.
For that reason, you may notice that the laser pulses appear more frequently while hitting low flying ships because it is quicker to hit a low flying ship than a high flying ship.
Idea: HN Invaders. Replace the alien ships with floating idiotic HN comments. Each time you hit one, its flag count goes up, and then after a couple it dies and disappears (except if you toggle the game's showdead mode).
Web Serial API would also mean one could create an Atari-style paddle controller to go with this game, kind of like this project: https://github.com/drohen/paddle-game
If you're building something with a microcontroller, turn it into a USB HID gamepad device with an analog axis or digital (button) presses and then it should work with any browser right now: https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API...
Obligatory self-promotion: https://justin-lloyd.com/ which is my C.V. site that includes a 1970's-era space invaders style game based on the portable Galaxy Invaders 1000 game.
https://github.com/JustinLloyd/invaders
"Invaders from 78" is written in Typescript, implements a small ECS framework, uses Pixi for canvas rendering, and is event driven. No audio because, well... it's a C.V. website. It also doesn't work on mobile because the audience numbers for mobile visitors to my C.V. website is near enough zero that it would be wasted effort. Please excuse any front-end sins I may have committed because I generally don't do front-end web dev.