oakes / play-clj

A Clojure game library
The Unlicense
940 stars 72 forks source link

first-entity and second-entity crash when there are entities without a :body #91

Closed scheibenkaes closed 8 years ago

scheibenkaes commented 8 years ago

Given you have entities with and entities without a :body in the same screen, trying to detect a collision will result in an exception:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.Exception: The keyword :body is not found.

This is due to find-body using get-obj which throws the key not found exception.

I tried the workarounds:

Did I get something wrong or wouldn't be better to ignore those entities without a body in the implementation of first- and second-entity?

oakes commented 8 years ago

Yeah that was definitely an oversight. I just fixed it and pushed 1.1.0-SNAPSHOT so you can try it out.

scheibenkaes commented 8 years ago

Tried it and the issue is now gone. Thanks for fixing and for this great project in general!