db0 / godot-card-game-framework

A framework which comes with prepared scenes and classes to kickstart your card game, as well as a powerful scripting engine to use to provide full rules enforcement.
http://dbzer0.com/projects/godot-card-game-framework/
GNU Affero General Public License v3.0
952 stars 100 forks source link

Make Piles have higher drop priority than Hands #54

Closed db0 closed 3 years ago

db0 commented 3 years ago

To improve on #53 I should probably figure out a workaround to make Pile have higher priority for card drops, than Hand, when a card's Area2D collides with both, as it's the natural way people expect (to target the hand, they usually move the card to the middle position).

I cannot move the Hand node higher in the node hierarchy, as that would cause the card-draw animation to show the card be picked from the bottom of the pile. This is because I first change parents, then execute the animations, so the relative z_index of the two CardContainer nodes matters.

I am thinking just have the CardDrop logic prioritize cfc.piles over cfc.hands