Live data from Hacker News

Create a simple cross-platform desktop game with Go

sausheong.github.io

1–10 of 23 posts

Re: Create a simple cross-platform desktop game with Go

#2
Wasn't aware of the mentioned "webview" wrapper[1], considering to use it for a side project.

Reminds me of the time I created an improved version of the "8-puzzle"[1] game in Go to learn about "channels" and "goroutines". Especially, the use of "select" statement for listening on multiple channels for the main event loop.

[1] https://github.com/zserge/webview

[2] https://github.com/pravj/puzzl

Re: Create a simple cross-platform desktop game with Go

#4
Interesting, though what this actually does is run a local webserver so I assume it would be even simpler to just open the default web browser pointed to the local server? But then you start thinking that sound output could also be handled via the audio API and one could even play this remotely. So what you created is a webapp? Why even run it locally at all then... just some thoughts. Still a cool idea to circumvent the lack of good native UI support in go I guess.

Re: Create a simple cross-platform desktop game with Go

#5

Interesting, though what this actually does is run a local webserver so I assume it would be even simpler to just open the default web browser pointed to the local server? But then you start thinking that sound output could also be handled via the audio API and one could even play this remotely. So what you created is a webapp? Why even run it locally at all then... just some thoughts. Still a cool idea to circumvent…

> Why even run it locally at all then

Latency?

Re: Create a simple cross-platform desktop game with Go

#6
For cross platform game / 3D development in Go, there are a few frameworks and libraries already in place:

https://github.com/avelino/awesome-go#game-development

g3n seems like the most promising recent candidate:

http://g3n.rocks

https://github.com/g3n/engine

Azul3D used to be a promising candidate, but looks to be very dead now. :(

Re: Create a simple cross-platform desktop game with Go

#8
I've been tinkering with writing a simple game in Golang as well. I don't think it's a good idea to lob in an entire web browser for a game, though. I've been using the go-gl stack:

https://github.com/go-gl

They have a wrapper for GLFW and OpenGL, I've been using GLES2 which has good compatability with everything. You have to be prepared to learn how to write shaders and use OpenGL, though, so it can be a bit intimidating. Here's the (extremely incomplete and very bad) game I have so far:

http://git.sr.ht/~sircmpwn/freefood

Re: Create a simple cross-platform desktop game with Go

#9
See also https://github.com/oakmound/oak if you are interested in a pure-Go library (i.e. one which doesn't need cgo) with no HTML & JS dependencies. (Disclaimer: haven't used it so not sure what's the status; but reportedly it's been used by its author to write a game.)

Re: Create a simple cross-platform desktop game with Go

#10

For cross platform game / 3D development in Go, there are a few frameworks and libraries already in place: https://github.com/avelino/awesome-go#game-development g3n seems like the most promising recent candidate: http://g3n.rocks https://github.com/g3n/engine Azul3D used to be a promising candidate, but looks to be very dead now. :(

SDL2 + OpenGL as well
Post reply on HN