• Stars
    star
    153
  • Rank 243,368 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terminal Space Invaders written in Go

Space Invaders

Terminal Space Invaders game written in Go.

Screenshot 1 Screenshot 2

Joystick bug

I've just found out that Ubuntu recognises my Microsoft keyboard as both a keyboard and a joystick, meaning it creates /dev/input/js0 despite the fact that there is no joystick connected. The result is that the data read from this input can cause unwanted key press events in the game, making it unplayable.

The quickfix is to simply sudo rm /dev/input/js0.

Alternatively you can establish a rule for js0.

Installation

go get -u github.com/asib/spaceinvaders
cd $GOPATH/src/github.com/asib/spaceinvaders
go build

You can also simply download a binary for your OS/Arch from here.

Controls

  • Use the arrow keys to move left/right, spacebar to fire.
  • Press q at any time to quit.

The game will adjust the number of "invaders" to (roughly) fit your terminal's screen size. This means you can make the game more/less difficult by making your screen bigger/smaller. Just make sure you don't resize the screen once you've started playing, else the game will crash.

If you're having trouble fitting all the graphics onto your terminal screen, even when it's maximised, lower your font size.