Hi all! A question from newbe - I make a simplistic RTS prototype to plays with various game mechanics and learn Godot.
Currently my sandbox looks as follows:
Locations - spawn units
Units - move betwen locations
Both Locations and Units are Area2D, can be selected on a mouse click, all attached to a root Node2d.
Question I have - what will be the best way to deselect other units on click?
I currently look into the following:
1) make a 'cursor' object that once select a new Location or Unit - will emit signal to others to get deselected
2) selected Location/Unit sends a signal to Root node and the latter looks into all its Location and Unit children and makes them deselected. Appreciate your recommendation on what will be the best way to iterate thru the children nodes.
Can you please suggest what will be the best approach, what I can be missing here. What patterns are commonly used in games without map grid?