[HN Gopher] Show HN: I made a 2D shoot 'em up game with Go, usin...
___________________________________________________________________
Show HN: I made a 2D shoot 'em up game with Go, using Entity
Component System
Author : m110
Score : 87 points
Date : 2022-12-01 11:29 UTC (11 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| smcl wrote:
| Nice work! Must have been fun to make :)
| m110 wrote:
| It 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. :)
| xwdv wrote:
| Entity 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.
| koblas wrote:
| Great work here, while I suck at games, it's great to see how Go
| can be used to build browser based applications.
| NortySpock wrote:
| Beautiful 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 wrote:
| Thank you!
|
| Go makes it ridiculously easy: GOOS=js
| GOARCH=wasm go build -o web/game.wasm
| arriu wrote:
| This 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
| wyldfire wrote:
| Constructive 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!
| m110 wrote:
| Thanks! The game is not really balanced at this point, it
| definitely could use some play testing and improvements. :)
| bluenotebo0k wrote:
| Fire rate becomes faster as you collect powerups.
| ezekg wrote:
| It'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.
| pjmlp wrote:
| Looks quite nice, time travel back to my Speccy days.
| ezekg wrote:
| For the curious, here's the ECS package this is built with:
| https://github.com/yohamta/donburi
| dvh wrote:
| IMO 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.
| m110 wrote:
| It'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. :)
| nikki93 wrote:
| I 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 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
|
| 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.
| whateveracct wrote:
| The most efficient game engine is the one you'll actually
| use!
| mjfisher wrote:
| Oh, come on. This obviously isn't pretending to be a highly
| polished game experience - it's something someone made for a
| game jam, and they've taken the time to publish it and write it
| up to a reasonable degree so that other people can take a look
| at, if they wish.
|
| They chose exactly the right tech for the job they intended - a
| fun experiment in a particular language and framework, and a
| write up based on that. They perhaps chose the wrong tech for
| your expectations?
| danuker wrote:
| You refresh rarely.
|
| A lot of native games take longer than that to load.
| johnfn wrote:
| Very 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 wrote:
| Glad to hear that! :D
|
| As mentioned in the other comment, the heavy lifting is done by
| Ebitengine:
| 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 wrote:
| This is great! Super fun to play. Congrats on releasing it!
| hknmtt wrote:
| great to see Go doing more than just web backends and networking.
| LordHeini wrote:
| For me the third level does not load on the web version.
|
| The ship just gets stuck on the end of lvl 2.
| m110 wrote:
| There are only two levels at the moment, it's still a
| prototype. :) And missing a "well done!" screen, obviously.
| [deleted]
| pmontra wrote:
| Firefox Ubuntu: black screen and "panic: atlas: the image being
| put on an atlas is too big: width: 480, height: 2400" in the
| console.
___________________________________________________________________
(page generated 2022-12-01 23:02 UTC)