diff --git a/game/src/Piece.gd b/game/src/Piece.gd index 55958b6..a512067 100644 --- a/game/src/Piece.gd +++ b/game/src/Piece.gd @@ -4,14 +4,14 @@ class_name Piece export var size: int = 160 -var number: int = 0 -var taquin_position = Vector2.ZERO -var taquin_index = Vector2.ZERO -var piece_scale = Vector2(0.25, 0.25) +var order: int = 0 +var taquin_position := Vector2.ZERO +var taquin_index := Vector2.ZERO +var piece_scale := Vector2(0.25, 0.25) func _ready() -> void: $ColorRect.rect_size = Vector2(size, size) - $ColorRect/Label.text = str(number) + $ColorRect/Label.text = str(order) # We need a dedicated material to have separate uniform, # otherwise uniforms will be shared. diff --git a/game/src/Taquin.gd b/game/src/Taquin.gd index 853080a..2f05810 100644 --- a/game/src/Taquin.gd +++ b/game/src/Taquin.gd @@ -67,7 +67,7 @@ func _ready() -> void: piece.size = piece_size piece.position = position_for_index(Vector2(c, r), piece.size) - piece.number = 1 + c + r * columns + piece.order = 1 + c + r * columns piece.taquin_index = Vector2(c, r) piece.piece_scale = Vector2((float(piece_size) / width), (float(piece_size) / height)) piece.taquin_position = Vector2(float(piece.position.x) / width, float(piece.position.y) / height)