require balls to be stationary on goals

This commit is contained in:
mehbark 2025-05-04 15:29:29 -04:00
parent 379ea91bbc
commit e4355757fb
2 changed files with 3 additions and 3 deletions

View file

@ -46,5 +46,5 @@
; 4 pool
#############
# @ o o_ . #
# @ o. o_ . #
#############

View file

@ -124,8 +124,8 @@ func step(move: Vector2i):
func won() -> bool:
for piece in board.pieces():
if piece.type == Piece.Type.Goal:
var covered := board.any_at(piece.lpos, func(p): return p.type == Piece.Type.Ball)
if !covered:
var ball := board.type_at(piece.lpos, Piece.Type.Ball)
if !ball or ball.lvel != Vector2i.ZERO:
return false
return true