set piece reflection when winning
This commit is contained in:
parent
6b17d2ea8a
commit
9830c5c51d
3 changed files with 118 additions and 30 deletions
|
@ -301,6 +301,12 @@ func ensure_validity() -> void:
|
|||
assert(piece.taquin_index.x == c)
|
||||
assert(piece.taquin_index.y == r)
|
||||
|
||||
func set_pieces_reflection(value: bool) -> void:
|
||||
for c in range(columns):
|
||||
for r in range(rows):
|
||||
var piece = pieces[c][r]
|
||||
piece.set_reflection(value)
|
||||
|
||||
func current_state_name() -> String:
|
||||
return State.keys()[current_state]
|
||||
|
||||
|
@ -313,6 +319,7 @@ func transition_to(state):
|
|||
match current_state:
|
||||
State.WINNING:
|
||||
$Particles2D.emitting = true
|
||||
set_pieces_reflection(true)
|
||||
$Timer.start(-1)
|
||||
State.GAME_OVER:
|
||||
$Particles2D.emitting = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue