played cards get removed from hands and (wrongly) added to the stack

This commit is contained in:
2025-07-16 11:59:52 +02:00
parent f39c9e46d9
commit f7127b94d5
5 changed files with 15 additions and 5 deletions
+3 -1
View File
@@ -3,13 +3,15 @@ extends Node3D
var _card_height: float = 0.06
@export var playing_card_scene: PackedScene
func add_card(card: PlayingCard) -> void:
var height = self.get_child_count() * _card_height
self.add_child(card)
card.translate(Vector3(0, height, 0))
func add_card_by_id(card_id: int) -> void:
var playing_card: PlayingCard = PlayingCard.new()
var playing_card: PlayingCard = playing_card_scene.instantiate()
playing_card.setup_card_details(card_id)
add_card(playing_card)