quil

plexus 2022-03-11T10:46:44.458719Z

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
plexus 2022-03-11T10:47:08.811179Z

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

👀 1
Akiz 2022-03-13T16:08:35.818329Z

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.

genmeblog 2022-03-11T14:06:11.698759Z

@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?

plexus 2022-03-11T14:12:23.652489Z

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 🙈

plexus 2022-03-11T14:12:53.609779Z

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

plexus 2022-03-11T14:14:11.370019Z

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

genmeblog 2022-03-11T14:15:33.897639Z

Good!

plexus 2022-03-11T14:16:04.668919Z

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

genmeblog 2022-03-11T14:33:06.958889Z

ok, made it, source code is here: https://github.com/Clojure2D/clojure2d-examples/tree/master/src/box2d

genmeblog 2022-03-11T14:33:27.937769Z

I've added a line in README too

genmeblog 2022-03-11T14:34:52.423409Z

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.

genmeblog 2022-03-11T14:37:31.162939Z

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

genmeblog 2022-03-11T14:58:49.584949Z

cc @plexus

plexus 2022-03-11T15:01:01.613979Z

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

plexus 2022-03-11T15:01:53.591319Z

so turn it into lambdaisland.cljbox2d.clojure2d

genmeblog 2022-03-11T15:03:53.145759Z

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

plexus 2022-03-11T15:06:46.729789Z

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

👍 1
genmeblog 2022-03-11T15:25:29.033119Z

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

plexus 2022-03-11T15:30:16.397179Z

Sure! They would be most welcome!

genmeblog 2022-03-11T15:32:57.859369Z

Perfect, I'll prepare first approach this weekend 🙂

plexus 2022-03-11T15:47:13.060449Z

🙏

genmeblog 2022-03-11T14:19:11.715609Z

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