fix board pieces sorting

This commit is contained in:
mehbark 2025-05-31 11:44:17 -04:00
parent 2b5113406e
commit 749079ee44
2 changed files with 2 additions and 1 deletions

View file

@ -26,7 +26,7 @@ func pieces() -> Array[Piece]:
# important for consistency.
# everything involving pieces is done top to bottom, then left to right
# expensive? yes. wasteful? definitely. worth it? i think so.
sorted.sort_custom(func(a, b): return a.lpos.y < b.lpos.y or a.lpos.x < b.lpos.x)
sorted.sort_custom(func(a, b): return a.lpos.y < b.lpos.y or (a.lpos.y == b.lpos.y and a.lpos.x < b.lpos.x))
return sorted
func pieces_at(pos: Vector2i) -> Array[Piece]:

View file

@ -26,6 +26,7 @@ var levels: Array[PackedScene] = [
preload("res://level/diagonal_bounce_00.tscn"),
preload("res://level/ball_bounce_00.tscn"),
preload("res://level/timing_00.tscn"),
preload("res://level/lvel_cancelling_00.tscn"),
]
var time := 0