This is a thrown together remix of the Ebiten platformer example. The difference is that this allows you to host a Websocket server and connect with native or web clients.
!!!Warning!!!
This has bugs, sub-optimal networking code and poor error handling. This was hastily put together to show that this is possible with Go. Use this more as a loose guide to getting started!
!!!Warning!!!
go get github.com/silbinarywolf/networkplatformer-go
- Golang 1.10+
- Gorilla Websockets (for native client and server)
- GopherJS Websockets (for JavaScript client)
These commands were all tested on Windows, running via Git Bash.
Build and run server
go build && ./networkplatformer-go.exe --server
Build and run client
go build && ./networkplatformer-go.exe
Build web client (requires GopherJS is installed)
GOOS=linux gopherjs build
Then open "index.html" in your browser of choice to run it. (Tested Chrome and Firefox)