I'm trying to make a card battle game, for example, I have 2 nodes A and B that represent 2 cards. What I want is that when I click on node A and then click on node B, then node A will attack node B. The attack here is simply subtracting damage from node B. No collision problems at all, just clicking and subtracting HP. So how should I code guys? Please help me. Thank you very much!

8 days later

This is too generic, you should read a Godot manual, or provide more exact information.

  • Odin replied to this.

    nestorac Case: You have node A and node B, you click mouse on node B, then node B loses HP according to node A's damage. So how do you code? (No collision!)

      AspireMint Yeah! Although I don't quite understand your example. But I found it to be quite effective. I will read it carefully. Sincerely thank you very much.

      Odin you should set a variable in A which can be 'hp', then you perform hp -= $B.get_damage()

      More or less... you need to add some scripts.

      • Odin replied to this.