I found mine, but is far away from yours.

After finishing the sprites, please implement floor casting... as far as I remember I couldn' make it.
Best regards
JF
Oh, like that.Jasoco wrote:The ONLY way to get sprites to show up in the right order is to have them sort themselves by how far they are. And in order to make them also sort behind walls you need to add every strip of the wall to the same table. Then sort the table so the far wall strips, far sprites all draw in order from far to near.
Code: Select all
table.sort(T, function(a, b) return a.z < b.z end)
Huh? The only problem I have with that is that table.sort only looks from index 1 to #T, so T[0] stays at the zeroth index, no matter its z-index.Jasoco wrote:It works for me. I know you say it's not trustworthy or reliable, but why would it exist if it isn't?
Okay. Good. That's probably why it works. I made sure to throw everything into the pool in order without gaps. Hooray for me!Robin wrote:Huh? The only problem I have with that is that table.sort only looks from index 1 to #T, so T[0] stays at the zeroth index, no matter its z-index.Jasoco wrote:It works for me. I know you say it's not trustworthy or reliable, but why would it exist if it isn't?
There's a big difference between Wolfenstein and MineCraft. In that Wolfenstein is very simple in comparison to the hundreds of thousands of blocks you have to process on every screen every frame in MC. Löve isn't that fast. At least not right now. Plus it doesn't have the right image manipulation functions to do it like Java does. (I wish it did. I want to warp an image to my will!)Nixola wrote:When will you make LÖVECraft?
Things change every frame if you move even a pixel. So it's not really as useful as it would be in a game where the map is static.bartbes wrote:As a suggestion for your z-ordering, it's probably easier to keep a sorted list around and insert in the right place than to sort the same list over and over every frame. Or do a full sort, but only in frames in which something changed, should help a lot.
Users browsing this forum: Ahrefs [Bot], Bing [Bot], cowardlycamper32, Google [Bot] and 15 guests