What node type do I use for displaying multiple cards at a time from a card deck?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By collectivenectar

I am a complete newcomer to everything (Godot, game design, coding in general), and I decided for my first larger project to try designing a program involving 2d cards.

I’d like to have a scene where player sees one card face down. When clicking on the face down card, a random card is invisibly chosen, an animation plays flipping the card over, and the card face is revealed. This is just for starters, as I’d eventually want to have scenes with multiple card containers displaying the card face down, and a random draw and flip animation for each card slot.

I have been soaking up as much as I can and while I may have bit off more than I can chew, I’m committed to just learning as I go even if I’m failing horribly. At this point I cannot find any GitHub projects plugins, or tutorials related to card games in Godot to help me find what type of node I should be using for my animations. I have been trying to use AnimatedSprite, storing multiple animations in one node, and trying to figure out how to call an individual animation at random, but either I’m just too new to the scripting or I’m using the wrong node type.

What would the node tree structure look like for this scene, and what node would I be loading the card sprites into?

edit: I also forgot to mention(just in case it changes what I should be using) that I’d like to also display unique text for each card, text that describes the current visible card. This is for the one card at a time scene, but also for an ‘info’ button to look at individual cards whenever player wants to understand how a card works.

:bust_in_silhouette: Reply From: nathanwfranke

You shouldn’t need any fancy node types. You can get creative with AnimatedSprite and AnimationPlayer to create a flip animation

Thank you. Do I need to create one node for each card face?

collectivenectar | 2020-04-25 14:31

For each instance of a card, yes. For each type of card, you can make inherited scenes or different animations.

nathanwfranke | 2020-04-25 23:37