The visual effects of 3D are simulated through canvas 2d.
And in this project, protobuf is used to perform front-end and back-end communication protocols, which is very convenient!
WASD keys to control up, down, left and rightspace to enter a message, press Enter to send a messageThe latest support is to use docker-compose to start the service. After cloning the project, execute the following commands directly
docker-compose up -d
Visit http://localhost:8081
go run main.go
This command will start web-server as a static service, default to port 80. If you need to modify the port, use the following command
go run main.go -web_server 8081
The default websocket service port for the project startup is 9000 port, if modified
go run main.go -socket_server 9001
Note: If you modify the websocket port, you need to modify the socket port in js
Front-end Vue+canvas+websocket+protobuf
Backend Golang+websocket+protobuf+goroutine
Here are a few interesting problems encountered during the implementation process
protoc -I ./ *.proto --go_out=.
protoc --js_out=import_style=commonjs,binary:. *.proto
Canvas Basic Usage
Protobuf Guide
Vue.js