Tuesday, October 18, 2016

slick - Java Slick2d image depth/layering


I'm making a topdown 2d game, and I've made a decent entity system so far. But I want to do the following with it: I want to have drawing depth, so if, for instance, a tree is above another tree, then it should be drawn underneath the other tree. Here is basically a picture of what I mean.


This is what I'm trying to avoid:


This is what I have RN, but it's bad


Instead of that I want something like this:


This is what I'm trying to achieve automatically in rendering


If you have any idea how to do this, please tell me. If you need any code, here's basically what I do: In my main class I call a generate entities class. In that then I add Tree class-es to an arraylist through which it renders them. Thanks.




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...