Looks cool but really should mention early on that it doesn't use SDL or OpenGL to render the game but uses a specific feature of iTerm2 to render a series of images in the terminal, on other terminals it just shows a black screen.
It may be worth noting that the sprites are registered trademarks of Taito. So be careful…<p>(I learned this the hard way: I once had a rather poplar 404 page featuring a variant of the game [1], until I received a cease and desist letter from Taito…)<p>[1] Compare: <a href="https://gizmodo.com/this-space-invaders-404-page-is-the-funnest-404-error-p-510768455" rel="nofollow">https://gizmodo.com/this-space-invaders-404-page-is-the-funn...</a>
The invaders positions shouldn't all be updated every cycle, they should be updated one at a time, or in a separate thread, this is what the arcade machine does and due to its limited processing speed this naturally leads to the aliens speeding up as fewer aliens remain.<p>This implementation starts with the aliens going at what might be considered "full speed", and is probably much more difficult.<p><a href="https://www.giantbomb.com/space-invaders/3030-5099/" rel="nofollow">https://www.giantbomb.com/space-invaders/3030-5099/</a>
For anyone interested in making little games in Golang, Termloop[1] is a terminal-based engine (though it uses text to render rather than this iTerm-specific feature).<p>[1] <a href="https://github.com/joelotter/termloop" rel="nofollow">https://github.com/joelotter/termloop</a>
My understanding is that Go's ffi overhead[1] makes game development impractical at a certain level, due to the amount of opengl calls you have to make. Is this still the case?<p>[1] <a href="https://github.com/dyu/ffi-overhead/blob/master/README.md" rel="nofollow">https://github.com/dyu/ffi-overhead/blob/master/README.md</a>
This is awesome, and something I was doing as well for fun! Go's image package has some pretty nice primitives. One thing I think would make this even simpler is you could simply sequence the individual sprites using image.NewRGBA and simply setting the Pix slice to the values to draw the appropriate images, then you can avoid going to the os at all!
Here's also a cool example of a game written in go, although using JS to display GUI: <a href="http://blog.u2i.com/we-made-a-multiplayer-browser-game-in-go-for-fun/" rel="nofollow">http://blog.u2i.com/we-made-a-multiplayer-browser-game-in-go...</a>
Cool, and a great programming tutorial!<p>I was thinking I might see Go in a device-control application, but alas not. The program uses a modern computer's video system. The original Space Invaders code likely had to shift pixels out to the video display in realtime. So a different programming feat entirely, but still cool!
Dupe - posted yesterday by the original project author, but with only two comments[0]<p>I think a moderator should consider merging this thread with the original, if possible.<p>[0]<a href="https://news.ycombinator.com/item?id=16287030" rel="nofollow">https://news.ycombinator.com/item?id=16287030</a>