Categorygithub.com/dstoiko/go-pong-wasm
repositorypackage
0.0.0-20231106055216-a4dabfa29f1b
Repository: https://github.com/dstoiko/go-pong-wasm.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Pong in Go

This is a pet project to try out WebAssembly with Go (golang) in a fun way. The game should be available on my blog. You can also build it and try locally on desktop.

Demo

The AI always wins...

Features

  • Works on desktop (Linux, MacOS, Windows)
  • Works in web browsers using WebAssembly
  • 2-player "VS" mode with same keyboard
  • Survival-style "AI" mode with unbeatable AI (unless you find a glitch)
  • Difficulty/speed increases as you play

Build locally

First, git clone and cd into this repo.

Native desktop version

  1. Run make native to build for native desktop (Linux, MacOS, Windows)
  2. Run the game binary: ./build/pong

WebAssembly version (browser)

  1. Run make wasm to build for WASM target
  2. Run the simple web server locally: go run server/server.go
  3. Run the game inside a browser at https://localhost:8080

TODO / Ideas

  • Make it work on mobile (gomobile compilation targets + touch/drag handling of paddles)
  • Add sounds from original Pong game
  • Add crazy mode with multiple balls
  • Add leaderboard