Fork me on GitHub
#quil
<
2022-03-11
>
plexus10:03:44

As posted in #announcements I've cut a first release of cljbox2d. This is a library I put a bunch of work in a bit over a year ago, but haven't really touched since then. The story is: my nephew wanted to make a game, so I started teaching him some Clojure and Quil, and started looking into how to add some more game-enginy capabilities to Quil. That's how cljbox2d came about. Then it turned out it had (for reasons) be a browser based game, so I made cljbox2d cljc compatible. In the end we ended up making a point-and-click adventure game, for which you really don't need any physics, and I went with Pixi.js instead, which became another wrapper libary (lambdaisland/puck). But I'm still really happy with cljbox2d, and the API is infintely nicer to deal with than the original (j)box2d.

👀 1
plexus10:03:08

The point-and-click game became https://invasie-van-de-robots.rocks/

👀 1
Akiz16:03:35

Nice game :-). I dont speak the language unfortunately. Btw. It may be good to move items to the top so it doesnt block right movement when playing on small mobile screen.

genmeblog14:03:11

@plexus this is great and works (using clojure2d as a renderer, instead of quil)! One minor request: is to possible to make Vec2 also Seqable (to be able to call seq, first, second on it) not only Indexed?

plexus14:03:23

probably, see https://github.com/lambdaisland/jbox2d . I had to fork jbox2d in order to implement these clojure interfaces, and I don't remember how I did the deploy the clojars 🙈

plexus14:03:53

seems very little has changed upstream at first glance, so that's good

plexus14:03:11

But I can figure that out again, I guess I just used maven directly. PR welcome! see https://github.com/lambdaisland/jbox2d/commit/267c0ea5fe49c78e71735f5be57c34aecbc39c32

plexus14:03:04

very cool that you got it working with clojure2D as well! if you have a sample (maybe a gist?) it would be great to link to in the README

genmeblog14:03:27

I've added a line in README too

genmeblog14:03:52

if you want me to add something specific (about the licence, better description, etc.) please let me know. Source code includes a link to the original code.

genmeblog14:03:31

And thanks for making that! This is so helpful library.

plexus15:03:01

This is great! Thanks a lot! How would you feel about contributing the box2d.common code to cljbox2d?

plexus15:03:53

so turn it into lambdaisland.cljbox2d.clojure2d

genmeblog15:03:53

Sure, why not! As I understand, dependency to clojure2d should be as an alias in deps.edn, right?

plexus15:03:46

yes, and then add it to bin/proj to :alias-as-optional-dependency

👍 1
genmeblog15:03:29

do you want me to include also demos (maybe in lambdaisland/cljbox2d/demo/clojure2d/)?

plexus15:03:16

Sure! They would be most welcome!

genmeblog15:03:57

Perfect, I'll prepare first approach this weekend 🙂

genmeblog14:03:11

Sure! I'll push it in 30 minutes (working on pyramid example, just got hit by non seqable vector). It will be a part of clojure2d-examples repo.

❤️ 1