From 76b16ada7a284ff81e7828eb72a375c8866d0604 Mon Sep 17 00:00:00 2001 From: jake Date: Sun, 19 Feb 2023 04:06:56 -0500 Subject: pawn promotion (to queen) --- Sprite.gd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Sprite.gd') diff --git a/Sprite.gd b/Sprite.gd index 263addc..d535946 100644 --- a/Sprite.gd +++ b/Sprite.gd @@ -51,15 +51,16 @@ func _ready(): func init(new_piece, color, new_team = 0): get_texture().set_region(Rect2(new_piece, color, CELL_W, CELL_H)) - self.set_piece(self.get_piece_name_by_region()) + self.set_piece(self.get_piece_name_by_region(), self.get_piece_color_by_region()) self.set_team(new_team) func _on_Area2D_input_event(_viewport, event, _shape_idx): if event.is_action_pressed("mouse1"): emit_signal("clicked") -func set_piece(new_piece): +func set_piece(new_piece, color): piece = new_piece + get_texture().set_region(Rect2(self.piece_map.get(new_piece), self.piece_color.get(color), CELL_W, CELL_H)) func get_piece(): return piece -- cgit v1.2.3