Godot Version
4.4
Hello people!
i’ve been making a card game and i have almost no expirience with programming. i’ve followed a tutorial on yt and it has ben going fine, but now i have to diverge from the tutorials and so i’ve been slowly learning how to do stuff..
i’m trying to the highest value card in my opponent hand but i’m kinda going crazy. this is the database i’ve made for the cards:
const CARDS = { #Valore, Value, Type, Ability, Ability Script
“Ace” : [“A”, 14, “Numero”, null, null],
“King” : [“K”, 13, “Magic”, “Guarda la mano avversaria e ruba una carta”,“res://Scripts/Abilità/King.gd”],
“Jack” : [“J”, 11, “Magic”, “Pesca una carta”,“res://Scripts/Abilità/Jack.gd”],
“Queen” : [“Q”, 12, “Magic”, “Può essere giocata prima o dopo il Re”,“res://Scripts/Abilità/Queen.gd”],
}
after that i have a funcion that puts cards in my opponent’s hand:
func add_card_to_hand(card, speed):
if card not in opponent_hand:
opponent_hand.insert(0, card)
update_hand_positions(speed)
that i’m calling at the start of the game to have it draw 3 cards:
where do i find the values of the cards in the hand? as you can see in the commented lines ive tried (and succeded) to get the values making a new array, but i still don’t know how to tell the stupid game that thats the card i want lol.
i’m sorry if this code is super messy but this is my first project.
thanks to anyone that reads this!!