TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Create a simple cross-platform desktop game with Go

151 点作者 sausheong将近 7 年前

10 条评论

Sir_Cmpwn将近 7 年前
I&#x27;ve been tinkering with writing a simple game in Golang as well. I don&#x27;t think it&#x27;s a good idea to lob in an entire web browser for a game, though. I&#x27;ve been using the go-gl stack:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;go-gl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;go-gl</a><p>They have a wrapper for GLFW and OpenGL, I&#x27;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&#x27;s the (extremely incomplete and very bad) game I have so far:<p><a href="http:&#x2F;&#x2F;git.sr.ht&#x2F;~sircmpwn&#x2F;freefood" rel="nofollow">http:&#x2F;&#x2F;git.sr.ht&#x2F;~sircmpwn&#x2F;freefood</a>
评论 #17788834 未加载
pravj将近 7 年前
Wasn&#x27;t aware of the mentioned &quot;webview&quot; wrapper[1], considering to use it for a side project.<p>Reminds me of the time I created an improved version of the &quot;8-puzzle&quot;[1] game in Go to learn about &quot;channels&quot; and &quot;goroutines&quot;. Especially, the use of &quot;select&quot; statement for listening on multiple channels for the main event loop.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;zserge&#x2F;webview" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zserge&#x2F;webview</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;pravj&#x2F;puzzl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pravj&#x2F;puzzl</a>
akavel将近 7 年前
See also <a href="https:&#x2F;&#x2F;github.com&#x2F;oakmound&#x2F;oak" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oakmound&#x2F;oak</a> if you are interested in a pure-Go library (i.e. one which doesn&#x27;t need cgo) with no HTML &amp; JS dependencies. (Disclaimer: haven&#x27;t used it so not sure what&#x27;s the status; but reportedly it&#x27;s been used by its author to write a game.)
评论 #17791119 未加载
splitbrain将近 7 年前
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.
评论 #17788484 未加载
评论 #17787803 未加载
TeddyDD将近 7 年前
Another good option is to use Raylib bindigs: <a href="https:&#x2F;&#x2F;github.com&#x2F;gen2brain&#x2F;raylib-go" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gen2brain&#x2F;raylib-go</a><p>No need for HTML&#x2F;js and API is pretty simple
评论 #17791143 未加载
holografix将近 7 年前
No mention of Ebiten? <a href="https:&#x2F;&#x2F;hajimehoshi.github.io&#x2F;ebiten&#x2F;" rel="nofollow">https:&#x2F;&#x2F;hajimehoshi.github.io&#x2F;ebiten&#x2F;</a>
gameswithgo将近 7 年前
You may also enjoy: <a href="https:&#x2F;&#x2F;gameswithgo.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gameswithgo.org&#x2F;</a><p>A video series where I teach programming via game projects. We do some software rendering, some SDL2, simplex noise, 2d rpgs, and some 3d opengl.
geoka9将近 7 年前
Not sure about game programming, but I really liked this for a portable browser-based GUI for my Go apps:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;icza&#x2F;gowut&#x2F;wiki" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;icza&#x2F;gowut&#x2F;wiki</a>
justinclift将近 7 年前
For cross platform game &#x2F; 3D development in Go, there are a few frameworks and libraries already in place:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;avelino&#x2F;awesome-go#game-development" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;avelino&#x2F;awesome-go#game-development</a><p>g3n seems like the most promising recent candidate:<p><a href="http:&#x2F;&#x2F;g3n.rocks" rel="nofollow">http:&#x2F;&#x2F;g3n.rocks</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;g3n&#x2F;engine" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;g3n&#x2F;engine</a><p>Azul3D used to be a promising candidate, but looks to be very dead now. :(
评论 #17788453 未加载
alienspaces将近 7 年前
This is cool, thanks for sharing!