Skip to content

Commit 7b20823

Browse files
committed
Sort sprites by X pos, fix sprite loading order for practice mode restore
1 parent 60ccd7e commit 7b20823

File tree

6 files changed

+526
-523
lines changed

6 files changed

+526
-523
lines changed

LEVELS/export_levels.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ def getDictFromOffsetSettings(offsetSettings : Iterable[dict], alreadyExistingDi
467467

468468
if overflowStart > 0:
469469
overflows.append([level, overflowStart, -1])
470+
471+
# Explicitly sort sprites by X, then Y
472+
level_data.sort(key=lambda s: (s[0] | (s[1] << 8), s[2] | (s[3] << 8)))
470473

471474
level_data.append([0xff]) # add terminator byte
472475
all_data.append((level, len(level_data) * 5 - 4, level_data, num))

0 commit comments

Comments
 (0)