- Edited
Hello everyone, long time no see.
I'm having less of a problem and more of an uncertainty about 'Godot's game design', and was hoping to hear some advice.
I'm making a card game (similar to slay the spire) in which the player can create a basic deck in the menu, but the deck changes along the run. For now I made the Card Database as a Dictionary as follows:
all_cards = {
'strike' : { 'name' : 'Strike', 'cost' : 2},
'bash' : { 'name' : 'Bash', 'cost' : 3}
}
The initial, user created deck is just an Array with the card names like: deck_list = ['strike', 'strike', 'strike', 'strike']
At the beginning of the run the game search the database with the card names, and creates another Array of the "card contents". Like so:
deck_cards = [{ 'name' : 'Strike', 'cost' : 2}, { 'name' : 'Strike', 'cost' : 2}, { 'name' : 'Strike', 'cost' : 2}, { 'name' : 'Strike', 'cost' : 2}]
With this I can modify cards, add more cards or remove them independent if they started as the same card.
Recently I was presented with the idea of using resources for the Card Database. Basically create a CardBase.gd, and for each card save a .tres
file extending this base resource. So to have a folder of files where each file is a card.
The initial, user created deck would still be a list of names like before. Based on the docs at runtime I would simply create a Dictionary where each card is an instantiated resource, like:
export var deck_res = {
'card01' : 'strike.tres',
'card02' : 'strike.tres',
'card03' : 'strike.tres',
'card04' : 'strike.tres'}
From early test each card in this dictionary has an unique resource, and can be manipulated separately from one another.
So here my question: Should I refactor my game to use this resource approach or just keep the original Dictionary Database approach?
Cheers