fix board pieces sorting
This commit is contained in:
parent
2b5113406e
commit
749079ee44
2 changed files with 2 additions and 1 deletions
2
board.gd
2
board.gd
|
@ -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]:
|
||||
|
|
1
main.gd
1
main.gd
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue