How to Draw a Space Invader

muffinman.io

489 points by abdusco 21 hours ago


abetusk - 13 hours ago

I've also made a space invader generator.

live version: https://abetusk.github.io/iao/vadfad_1gen/

source: https://github.com/abetusk/iao/tree/main/vadfad_1gen

Inspired by Jared Tarbell (linked from another comment here from levitated.net).

I found it surprisingly easy to get good results. The major components are the eyes, bilateral symmetry and otherwise random pixels within a small rectangle, if I remember correctly.

stevage - 13 hours ago

Wow, the results are really good: https://muffinman.io/invaders/

Much better than you'd expect from the article.

Also, TIL about [oklch](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value...).

pachevjoseph - 20 hours ago

This is one of the best mobile experiences I’ve had reading an article.

- 3 hours ago
[deleted]
MisterTea - 8 hours ago

Apparently someone drew a space invader on this pigeon walking in front of me the other week ;-) https://files.catbox.moe/pzwgr8.jpg

taeric - an hour ago

Really fun read. Love how it tracks where you are to do specific things in the drawing and I'm surprised I don't see this done more.

Clicking through to the rope page, it is a really good strategy for web pages.

dangond - 3 hours ago

Got a fun little heart-shaped guy that morphs into a ditto when animated here, love the variety! https://muffinman.io/invaders/#/size:9/main-seed:officer-clo...

plasticeagle - 9 hours ago

May I say that this website is one of the loveliest and most pleasant to read that I've ever seen.

Martin_Silenus - 18 hours ago

Nice.

Ironically, this is much like saving the planet by creating invaders… the hacker way, without using brute force AI.

You deserve your upvote.

pjbk - 4 hours ago

Ahh... Brings me memories. Back in the 80s I did something similar after reading Dawkin's The Blind Watchmaker and his Biomorph evolution app. I wanted to recreate it but doing something more fun. So I hacked an Atari Logo space invaders game that used genetic programming on the invaders that survived most of the hits based on their shape (some pixels worked as shields) and motion. After 5 levels the game was almost impossible to beat.

CodeWriter23 - 3 hours ago

Heh, back in my day we used character sequences like >*< and <*> to animate and ran the whole game on an 80x24 ASCII terminal.

Biganon - 9 hours ago

Thank you for doing it the fun way, aka without AI

Modified3019 - 12 hours ago

The image/animation that sticks to the top, showing visually what is being talked about as we scroll is really nice work, and I typically hate fancy pages changes during scrolling.

scotty79 - 19 hours ago

If you refresh the page the invader that gets generated as you read changes.

appstorelottery - 7 hours ago

This is brilliant, your algorithm produces really great results - and your write-up is super! Would be great to have it as a simple function that we could use in our games ;-)

joemasilotti - 20 hours ago

This would be awesome as a random avatar generator!

gregschlom - 13 hours ago

Related, and from none other than 00's web legend levitated.net: http://www.levitated.net/daily/levInvaderFractal.html (2003)

h4ny - 16 hours ago

What a delightful read. Thanks for all the thoughts put into the problem solving, the writing, and the presentation!

netfortius - 13 hours ago

Cool. I've been collecting these from all over the world: https://www.space-invaders.com/flashinvaders/

Waterluvian - 20 hours ago

I’m surprised and impressed that it built a vector that it rasterized.

I wonder how well you can do by having a pseudo-random kernel walk and then mirroring it.

ygritte - 13 hours ago

A good space invader has to look badass and threatening. Extra points if it waves around its pincers in a grabbing motion.

balamatom - 18 hours ago

Nice, just the other day I coded up some quick 2d shooter demo and realized I have no idea how to draw interesting sprites for it. What you're doing here with drawing the generated vector onto different sizes of grid is brilliant. A sort of structured pulsation. Same simple technique can be used for both "breathing" animation of a critter and for animating it into bigger, badder forms. Bravo.

At this point (actually before even writing the comment) If your blog had a RSS feed I'd have subscribed to it... but (at least according to my RSS plugin) it doesn't, so I fear I will miss out on your next inspiring writeups. Consider adding one, if you feel like it :-)

https://muffinman.io/invaders/#/size:15/main-seed:began-ever... is a favorite so far

mock-possum - 4 hours ago

This is a REALLY good writeup, I’m incredibly impressed not only with the work itself, but the care put into explaining and demonstrating it. Much respect to the muffin man.

aa-jv - 10 hours ago

Very interesting article, and quite fun for those of us with a penchant for 8-bit aesthetics and retro-computing roots.

One thing that came to mind while reading this, was: isn't this just a human digital manifestation of Mother Nature's desire to just evolve everything into a crab shape?

Think about the symmetry and function of various appendages of the space invader, and how - eventually, all space invaders just look like crabs.

Are we seeing some sort of confluence in the Matrix here?

lzyuan1006 - 18 hours ago

Interesting, it takes a lot of imagination to do it

forrestthewoods - 13 hours ago

This was awesome. And the floating preview thingy worked great. Major kudos!

FridayoLeary - 18 hours ago

It's interesting that space invaders was developed entirely by one person.

Goldenbowl - 19 hours ago

Awesome!

Goldenbowl - 19 hours ago

[flagged]