Thanks for the compliment! I've got the source code on GitHub.
The basic algorithm is every card has a list of coordinates that it can attack or move, and every game tick if attack is off cooldown it will look for an opponent card to attack, and then if movement is off cooldown will move to a better available spot. The game class is the one that drives this, I conceptualize this like it's a kid playing with dolls.
That said, I made this in a week and there are plenty of ways to improve this code.
https://github.com/BoldBigflank/love-jam-2025-barnyard-brawl/blob/main/source/sc...