My HTML5 game open-source using Go as websocket server

833 views
Skip to first unread message

Paulo Coutinho

unread,
May 27, 2016, 11:49:05 PM5/27/16
to golang-nuts
Hi,

I want share my two new projects using Golang. 

A HTML5 bomberman like game and his multiplayer server using golang and websocket.

and

The game is registered in: www.golandy.com

Thanks.

Seb Binet

unread,
May 30, 2016, 6:44:20 AM5/30/16
to Paulo Coutinho, golang-nuts
I didn't manage to connect to a game (I keep getting a "blinking" 'connecting...') but 2 remarks:

- you should strive to comment your code in english instead of portugese (same for the git commit messages)
- you should also strive to run gofmt/goimports on your code to make it look kosher.

also, it looks to me like you should have r/w-mutexes to the Players and Bombs variables:
you seem to properly lock them for writing, but you also have at least one goroutine iterating over Players to send them something (sendToAll), as well as many other (quantityOfNPCs, all the goroutines inside wsHandler)

just my 2cents,
-s

Tyler Compton

unread,
Jun 8, 2016, 8:18:04 PM6/8/16
to golang-nuts, pa...@prsolucoes.com
I think the code would benefit from more commenting in general. I couldn't find any type or function comments anywhere. I'm not saying they are always necessary for exported functions and types, but I would say they usually are.

I'm getting the same issue that Sebastien is. I look forward to playing your game when that is resolved :)

Paulo Coutinho

unread,
Jun 8, 2016, 8:42:09 PM6/8/16
to Tyler Compton, golang-nuts

Hi

You need start the server too.

Or you can change the IP on boot file as described on readme.

I didnt comment because was not a public game when i started it.

Ty.

Reply all
Reply to author
Forward
0 new messages