https://github.com/psykhi/pong
A simple version of the game of pong, entirely written in Go and running in the browser
https://github.com/psykhi/pong
game go golang server webassembly
Last synced: 5 months ago
JSON representation
A simple version of the game of pong, entirely written in Go and running in the browser
- Host: GitHub
- URL: https://github.com/psykhi/pong
- Owner: psykhi
- Created: 2020-05-22T07:07:44.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-04T15:09:17.000Z (about 6 years ago)
- Last Synced: 2023-02-26T15:51:14.252Z (over 3 years ago)
- Topics: game, go, golang, server, webassembly
- Language: Go
- Homepage: https://pong-wasm.web.app/
- Size: 101 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
An online, multiplayer version of the game of pong, entirely written in Go and compiled to webassembly.
Running live at https://pong-wasm.web.app/. You can open another tab if no one wants to play with you ;(
# Getting started
- Compile the frontend code: `make`
- Start a fileserver to serve that code: `cd fileserver && go run server.go`
- Start the game server : `cd server/cmd && go run main.go`
- Connect to `localhost:3000`
# Architecture
Client and server run the game engine, running at 128 ticks. Client sends its keyboard/touch input at a fixed frequency to the server,
and both predict the next state of the game. When the client receives a server update, it reconciles both predictions by "replaying" the events that have happened since the last server packet was received.