Open grymmy opened 11 months ago
@leomcelroy stated he believed this is likely a regression. I will investigate this tomorrow by doing a git bisect and attempt to find the specific commit that caused this apparent regression.
This is a minimal example that does seem to demonstrate that the z-ordering is respected.
https://sprig.hackclub.com/share/3kovFmLi0HQaMQNvOMQd
Try swapping the order of the sprites.
What the bug should be in the provided example is that setLegend should clear the entire sprite table in the movement code.
onInput("w", () => {
getFirst(player).y -= 1
setLegend([ player, playerMaps[0]])
})
onInput("a", () => {
getFirst(player).x -= 1
setLegend([ player, playerMaps[1]])
})
onInput("s", () => {
getFirst(player).y += 1
setLegend([ player, playerMaps[3]])
})
onInput("d", () => {
getFirst(player).x += 1
setLegend([ player, playerMaps[2]])
})
The error may be here:
https://github.com/hackclub/sprig-engine/blob/main/src/web/index.ts#L94
Describe the bug A user reported that the documentation in the help panel states the following under
setLegend(bitmaps)
:however this link shows a game where it can easily be seen that this ordering is not respected.
To Reproduce Steps to reproduce the behavior:
Expected behavior draw order should respect setLegend documentation
Actual behavior
draw order does not respect setLegend documentation