Hi everybody, I�ll try and go straight to my problem.
A bit of context: I have a golem turret object (it is a sprite object, it has turret behaviour). These golem turrets appear when I click in the screen (for now). These turrets shoot rocks at the enemy (sprite object) which appers randomly in the screen and takes a journey toward a randomly defined path (pathfinding).
Objective: the golem "faces" the enemy it is shooting at depending on the position of the enemy (if we center our origin point at the current position of the tower then, if the enemy forms a 45 degrees angle with its position and that of the turret, and we assume clockwise angle as usual, then the golem faces front-right)
Note: I already have the frames to simulate the golem facing.
Problem: when I use the angle function (my golems have an instance variable named "Aim" which registers the angle formed between the position of the enemy and the golem), lots of enemies appear and lots of golems are placed, the golem seems to be unable to "choose" wich enemy "forms" the angle and won�t change its frame to simulate the facing behaviour.
Note: I already tried something like:
System every tick
golem has target -> golem Aim set value angle(enemy.x,enemy.y,golem.x,golem.y)
//logic to change frame depending on the angle formed
Sorry about my english, I know it is not the best. Any help would be appreciated.