Skip to main content
Commonmark migration
Source Link

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][1]][1]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][2]][2]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. [1]: https://i.sstatic.net/KpqpK.jpg [2]: https://i.sstatic.net/fjpDR.jpg

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][1]][1]

Instead of that I want something like this:

[![This is what I'm trying to achieve automatically in rendering][2]][2]

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. [1]: https://i.sstatic.net/KpqpK.jpg [2]: https://i.sstatic.net/fjpDR.jpg

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.

ImI'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 a , for instance, a tree is above another tree, then it should be drawn underneath the other tree. Here is baisiclybasically a picture of what I mean.

This is what ImI'm trying to avoid:

[![This is what I have RN, but it's bad][1]][1]

Instead of that I want something like this:

[![This is what I'm trying to achive automaticlyachieve automatically in rendering][2]][2]

If you have any idea how to do this, please tell me. If you need any code heres baiscily, here's basically what I do: In my main class I call a generate entityesentities class. In that then I add Tree class-es to an arraylist through wichwhich it renders them. Thanks. [1]: https://i.sstatic.net/KpqpK.jpg [2]: https://i.sstatic.net/fjpDR.jpg

Im 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 a , for instance, tree is above another tree then it should be drawn underneath the other tree. Here is baisicly a picture of what I mean.

This is what Im trying to avoid:

[![This is what I have RN, but it's bad][1]][1]

Instead of that I want something like this:

[![This is what I'm trying to achive automaticly in rendering][2]][2]

If you have any idea how to do this, please tell me. If you need any code heres baiscily what I do: In my main class I call a generate entityes class. In that then I add Tree class-es to an arraylist through wich it renders them. Thanks. [1]: https://i.sstatic.net/KpqpK.jpg [2]: https://i.sstatic.net/fjpDR.jpg

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][1]][1]

Instead of that I want something like this:

[![This is what I'm trying to achieve automatically in rendering][2]][2]

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. [1]: https://i.sstatic.net/KpqpK.jpg [2]: https://i.sstatic.net/fjpDR.jpg

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Tweeted twitter.com/StackGameDev/status/1000957308636155904
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user