Recommendations for game programming

I’ve been doing a bit of web programming with Purescript + Halogen and it’s been awesome. I was thinking maybe it would be fun to do a small web game. Are there libraries already out there that you would recommend for this? I think 3D is to involved. It would just need to be a 2D game library.
What I’ve seen so far

Emoji game engine

Sigment

Maybe it’s easiest to simply use the canvas

2 Likes

I ended up just using the canvas for https://GitHub.com/hdgarrood/multipac and I was pretty happy with that approach. Having said that, this was back when purescript was at v0.6 so a LOT has changed since then. I think canvas should still be a credible option but others may be better.

1 Like

Hey that’s really cool I hadn’t seen this game!. Yeah I have a experience with the canvas and I’m aiming at something super simple so might just start with this. Thanks for the link!

I found this frpong idea that uses Web Workers that seems like a novel approach.

2 Likes

hey i’m currently working on a game for the tic80 i like the fantasy console thingy cause it has a lot out of the box which is related to game programming and it supports javascript so i was tempted to get purescript running on this. Maybe you could take a look also on that. The games could later be converted to Html files that can be empedded. https://gitlab.com/m3tti/pstic80/

1 Like

Hey, sorry for reviving this old thread, but I’m standing in front of a similar decision and I wonder: what did you choose in the end, and how was it?

1 Like

Hi. I ended up using purescript-canvas and the experience was very good. The library seems to be actively maintained as well. For reference I basically looked at a lot of the canvas game tutorials. The calls are very similar and bear the same names etc. @hdgarrood example is also good to look at.
I abandoned the project because of other work but have been meaning to pick up on it again and publish it. Will let you know if/when that happens.

1 Like

Thanks for the quick response. I feared canvas might be too html-specific; I didn’t yet look at the API in detail, but I thourght it might not feel very purescript-y, sort of like using some bindings to C-libraries in other languages. Isn’t it like so? Does it “feel” good?

1 Like

True, it is kind of like using C-bindings etc. To begin with I was looking for something different and with a slightly different approach like FRP but I was very unclear on where to start with that. And because I was doing a simple game I thought it would be a good start to begin with something familiar. But yeah there is not much added on I guess except you get to write it in Purescript with some additional type checking. A more detailed up to date and maintained Purescript-y library I haven’t found so far.

1 Like

That’s what I feared. I made a new thread, hopefully it’ll attract some answers.

2 Likes