Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Writing Space Invaders in Go (sausheong.github.io)
9 points by sausheong on Feb 1, 2018 | hide | past | favorite | 2 comments


Great stuff! But I actually think implementing Space Invaders is much easier if done as a true "bitmap". An array of bits in memory. Rather than a sprite sheet.

Animation is just flipping the bottom rows. Collision detection is pixel precise. Rendering effects can also be optimized.

But the draw to bash shell looks like its running at high frame rate. Could this usher in a new dawn of terminal gaming?


You're probably right, I'm just mucking around with various things, didn't really thought too much about optimizing the code. The frame rate on the terminal is basically as fast as iTerm2 can display the image, I can't really control it (except maybe make it slower). It looks rather fast on the GIF because I cut down the number of frames in the GIF, but the actual game runs more reasonably.




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

Search: