asteroids

module
v0.0.0-...-906a54b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT

README

ASSHTEROIDS

A multiplayer terminal-based Asteroids game playable over SSH.

Features

  • Classic Asteroids gameplay in your terminal
  • Multiplayer over SSH - multiple players share the same game world
  • Web landing page with connection instructions
  • Docker support for easy deployment

Controls

Action Keys
Move Up W / I /
Move Down S / K /
Move Left A / J /
Move Right D / L /
Shoot Space
Quit Q

Quick Start

Run Locally

Play the game directly in your terminal:

make run

Start both the SSH server (port 22) and web landing page (port 8080):

docker compose up -d --build

Connect and play:

ssh -t localhost

View the landing page at http://localhost:8080

Stop the services:

docker compose down

Running Without Docker

SSH Server

Generate a host key and start the SSH server:

make generate-host-key
SSH_HOST_KEY=./keys/host_key make run-ssh

Connect:

ssh -t localhost
Web Landing Page
SSH_DISPLAY_HOST=your-server.com make run-web

Building

# Build all binaries
make build        # Local game
make build-ssh    # SSH server
make build-web    # Web server

# Run built binaries
./bin/game
./bin/asteroids-ssh
./bin/asteroids-web

Environment Variables

SSH Server
Variable Default Description
SSH_HOST 0.0.0.0 Host to bind the SSH server
SSH_PORT 22 Port for the SSH server
SSH_HOST_KEY - Path to SSH host key file
Web Server
Variable Default Description
WEB_HOST 0.0.0.0 Host to bind the web server
WEB_PORT 8080 Port for the web server
SSH_DISPLAY_HOST your-server.com SSH host shown on the landing page

Make Targets

Target Description
run Run the local game
run-ssh Run the SSH server
run-web Run the web landing page
build Build the local game binary
build-ssh Build the SSH server binary
build-web Build the web server binary
generate-host-key Generate SSH host key for local testing
docker-build Build Docker image
docker-run Run Docker container
docker-stop Stop Docker container
docker-logs View Docker container logs
fmt Format Go code
clean Remove build artifacts

Directories

Path Synopsis
cmd
game command
ssh command
web command
internal
config
Package config provides shared configuration utilities.
Package config provides shared configuration utilities.
draw
Package draw provides terminal drawing primitives and a scaled canvas.
Package draw provides terminal drawing primitives and a scaled canvas.
loop
Package loop provides the client-server game loop and state management.
Package loop provides the client-server game loop and state management.
loop/config
Package config centralizes all tunable game parameters.
Package config centralizes all tunable game parameters.
physics
Package physics provides collision detection and distance utilities.
Package physics provides collision detection and distance utilities.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL