added add_cards(), which now sorts cards before drawing them to the hand

This commit is contained in:
2025-07-15 09:09:04 +02:00
parent 8dde6a813f
commit 261e958a98
3 changed files with 21 additions and 23 deletions
+3 -2
View File
@@ -11,10 +11,8 @@ signal card_clicked(playing_card: PlayingCard)
func _enter_tree() -> void:
if card_details:
print("yeses!")
set_front_texture(CardManager.get_card_texture(card_details.card_id))
else:
print("NO!")
set_front_texture(CardManager.get_card_texture(-1))
func move_to(new_x_position: float) -> void:
@@ -29,6 +27,9 @@ func unselect() -> void:
func set_front_texture(texture: Texture) -> void:
card_mesh.get_surface_override_material(0).albedo_texture = texture
func setup_card_details(card_id: int) -> void:
self.card_details = CardManager.full_deck[card_id]
func _get_new_tween() -> Tween:
var tween = create_tween()
tween.set_trans(Tween.TRANS_BACK)