require balls to be stationary on goals
This commit is contained in:
parent
379ea91bbc
commit
e4355757fb
2 changed files with 3 additions and 3 deletions
|
|
@ -46,5 +46,5 @@
|
|||
; 4 pool
|
||||
|
||||
#############
|
||||
# @ o o_ . #
|
||||
# @ o. o_ . #
|
||||
#############
|
||||
|
|
|
|||
4
main.gd
4
main.gd
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue