/go-pong-websocket

🏓 Pong game written in Go with Ebiten framework - but it is controlled via websocket. For native and WebAssembly targets.

Primary LanguageGoGNU General Public License v3.0GPL-3.0

Pong in Go

This project is a simpler version of https://github.com/dstoiko/go-pong-wasm, used as a demonstration of a native app running pong in golang. If working on the pong exercise, you can use the logic in this project as an inspiration.

However, there are crucial differences between this project and the pong exercise:

  • The pong exercise is a online multiplayer pong written using Golang and React. This project is a native app letting two players play locally.
  • The pong exercise expect the client side displaying the game to be written in React, and the server side only maintaining state. This project actually draws the game state using Golang and the Ebiten framework.

Features

  • Works on desktop (Linux, MacOS, Windows)
  • 2-player "VS" mode with same keyboard

Build instructions

First, git clone and cd into this repo.

  1. Run make build to build for native desktop (Linux, MacOS, Windows)
  2. Run make run to start running the game.