This is my laptop configuration, the desktop one only differs in a few details (e.g. the total width of the bar due to a bigger screen resolution and no battery state etc.)
Remember my last post on how to turn concave polygons into convex ones so that you can actually use them in Box2D? Well, turns out my solution didn't quite work out that well. The thing is, if you mess up the order of vertices in the polygon (Box2D requires them to be in counter-clockwise order), the results are really weird and the collision starts bugging out. So I looked around for some better solution that would work more reliably. Read more
UPDATE: Improved (and actually working) version can be found in this new blog post.
So the next step since I fixed up the collision polygons last time was integrating physics into the game. Even though the game will not really be physics-based, it's a nice thing to have if only for the collision detection. After I had a little look around I decided to use JBox2D which is a Java port of the Box2D Physics library written in C. I also ha a look at fizzy which is supposed to be a nice wrapper around JBox2D, but unfortunately it hasn't been updated in a while and is simply broken. Read more
Hey guys in my first english post I decided to share how I implemented collision. For those who don't know, I'm currently playing with the Slick2D framework for Java developing some kind of RPG/tower defense thing (Yeah, I know, not a really clear idea).
Tile based collision really isn't much of a secret and there are tons of articles and tutorials on that topic. But I wanted a bit more complex shapes than saying whether a square tile is blocked or not. My first approach (which you can see on the right side) simply calculated a rectangle or polygon for each tile and placed them on the map. The result worked but was quite slow since for each tile you have to do a complicated collision. (By the way, for collision between any kind of shapes I'm just using the built-in functions of Slick, which might not be very fast or well implemented, but they work for now.) Read more