6 ms·
Show HN: I made a 2D shoot 'em up game with Go, using Entity Component System
- hknmtt 4y agogreat to see Go doing more than just web backends and networking.
- koblas 4y agoGreat work here, while I suck at games, it's great to see how Go can be used to build browser based applications.
- NortySpock 4y agoBeautiful game, thanks for sharing. Koblas's comment caught my eye and I will definitely be poking around the github actions code to learn how to compile Golang to WASM.
- m110 4y agoThank you! Go makes it ridiculously easy: GOOS=js GOARCH=wasm go build -o web/game.wasm
- arriu 4y agoThis is true but the rendering engine has done the heavy lifting to map calls to the gpu correctly. More build info here: https://ebitengine.org/en/documents/webassembly.html https://ebitengine.org/en/documents/webassembly.html
- wyldfire 4y agoConstructive feedback - coming from experience with games like "Time Pilot" or "Strikers 1945" - the firing recharge/repeat rate of this game seems too slow. Otherwise it was neat!
- bluenotebo0k 4y agoFire rate becomes faster as you collect powerups.
- ezekg 4y agoIt's too slow to start. It's too hard to destroy all the enemies in time if you miss. But code looks great! Really nice to see ECS in Go.
- m110 4y agoThanks! The game is not really balanced at this point, it definitely could use some play testing and improvements. :)
- xwdv 4y agoEntity Component Systems are definitely the key for making all kinds of interesting gameplay elements very quickly, and in ways you might not even think of initially.
- ezekg 4y agoFor the curious, here's the ECS package this is built with: https://github.com/yohamta/donburi https://github.com/yohamta/donburi
- pjmlp 4y agoLooks quite nice, time travel back to my Speccy days.
- pmontra 4y agoFirefox Ubuntu: black screen and "panic: atlas: the image being put on an atlas is too big: width: 480, height: 2400" in the console.
- LordHeini 4y agoFor me the third level does not load on the web version. The ship just gets stuck on the end of lvl 2.
- m110 4y agoThere are only two levels at the moment, it's still a prototype. :) And missing a "well done!" screen, obviously.
- dvh 4y agoIMO you chose wrong tech for the job. It is very simple 2D game yet it starts 5s on my desktop and 20s on my phone. If I would to make a simple game and even simplest program starts 20s I would stop right there and choose different technology. You probably did it to try Go, wasm and ECS and I understand that, but if you to make a game seriously, you should have stopped much earlier. In the early stage of the game development you should made 5-10 prototypes using different tech/frameworks and use the best one. I seriously don't see Go+wasm+ESC being the best one for this kind of game. How can you not go insane if you have to wait 20s for every page refresh.
- danuker 4y agoYou refresh rarely. A lot of native games take longer than that to load.
- m110 4y agoIt's not a "serious" project. I chose Go specifically because I like the language (and Ebitengine is super fun to work with) and I like the idea behind ECS. I made games with Unity before, which you could consider a "serious" engine, but the fun of development is nowhere near what I experienced here. Thinking about what would be the most efficient engine for the game would kill all the fun for me and the project wouldn't exist. :)
- whateveracct 4y agoThe most efficient game engine is the one you'll actually use!
- nikki93 4y agoI do also really like Go for various reasons, and have been working on a Go -> C++ transpiler and associated ECS libs to make a personal game project with. I used it to make a game for Raylib game jam earlier this year too: https://github.com/nikki93/raylib-5k https://github.com/nikki93/raylib-5k You can see what the development workflow looks like in this video (the ECS stuff also has a built-in editor like a much more minimal version of Unity's): https://www.youtube.com/watch?v=8He97Sl9iy0 https://www.youtube.com/watch?v=8He97Sl9iy0 I'm trying to decide how much time I should devote to making this easier to set up / use by other people in the medium term, since it's just a side project for me. Might make a codespaces template so it's quick to get started.
- smcl 4y agoNice work! Must have been fun to make :)
- m110 4y agoIt really was! There's something about moving sprites on screen that's super satisfying compared to using a big game engine. I definitely recommend trying out Ebitengine. :)
- deleted 4y ago[deleted]
- johnfn 4y agoVery cool stuff! I had a lot of fun getting all the powerups and becoming massively overpowered. :) How was using Go targeting wasm (I presume)? I'm personally concerned about compilation times being super long, but I guess I've never tried...
- m110 4y agoGlad to hear that! :D As mentioned in the other comment, the heavy lifting is done by Ebitengine: https://ebitengine.org/en/documents/webassembly.html https://ebitengine.org/en/documents/webassembly.html Go supports compiling to wasm, and it's as simple as: GOOS=js GOARCH=wasm go build -o web/game.wasm It takes just a few seconds for this project. :)
- jayunit 4y agoThis is great! Super fun to play. Congrats on releasing it!