Hacker News new | past | comments | ask | show | jobs | submit login
Andromeda Invaders: A 1980s-arcade-style game using HTML5, Canvas, Web Audio (github.com/susam)
116 points by susam on Feb 14, 2022 | hide | past | favorite | 25 comments



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.

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.


I couldn’t find a link, so here it is: https://justin-lloyd.com/invaders.html


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.


Why not audio?


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!

[0] https://memalign.github.io/p/pceimage.html

[1] https://memalign.github.io/m/pceimage/index.html


How might a project like this add a leaderboard with some kind of spoor prevention?


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.

lvl 7 on first try, mobile.


Pretty fun for a simple game. Difficulty level ramps up very quickly, perhaps overly so for a situation where eating quarters isn’t a goal.


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.


First attempt level 3. Love the Why you built this!


On a iPhone, levels 1 & 2 were an easy intro, then level 3 was pretty hard, and level 4 was very hard [and where I died IIRC].


Level 8 on one play (~3800 score).

Does the player's ship have autofire or is the player supposed to use a fire button?


Level 8 on one play is really good! :-)

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.


Tried twice, died pretty quickly on level 5


First try, level 6.


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).


Game hangs within 5 seconds from the start.

Oh no, it's my own fault. I hit space to shoot and it pauses. I didn't realize it autoshoots.


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...


Playability is great. Simple and addictive. Great job!


I love seeing well-organized code in a single HTML file - very easy to read and comprehend. Kudos!


Oh gosh, well done mate! I played it just like back-in-the-day... I'm terrible. Lvl 3


... but does it offer a different combination of 5 invaders every day? :-P


So cool, incredibly fun to be such a simple game. Sounds are a big part.


RIP Level 6. Nice job.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: