marklovers / kaplay

🦖 A JavaScript game library
https://kaplayjs.com
MIT License
230 stars 14 forks source link

fix: layers order should be backwards #186

Closed amyspark-ng closed 1 week ago

amyspark-ng commented 1 week ago

im currently making layers in my game, and i realized this

// the one on the bottom is the one that gets rendered first
layers([
    "background",
    "hexagon",
    "ui",
    "windows",
    "powerups",
    "logs",
    "sound",
    "mouse",
], "background")

isn't it weird that the one at the bottom of the list (visuallty) is the one that shows up on top of the other sprites?, feel free to close if im just dumb

niceEli commented 1 week ago

@mflerackers is this correct or no?

sorry if your sleeping for the ping.

amyspark-ng commented 1 week ago

yeah probably not a bug, just thought it was weird

mflerackers commented 1 week ago

I'll check it.

mflerackers commented 1 week ago

In the layers example there is

layers(["bg", "game", "ui"], "game");

and bg gets drawn first, then game, then ui.

amyspark-ng commented 1 week ago

then it's fine, my brain just looked at it weird