Hi guys,
I want to make turrets that shoot an animated object toward the enemy.
Probably not a bullet-like object, more like a channeling of magic or life-draining in my case.
This is what I have in mind.
What I did was making the turrets spawn a 'lifedrain' object when it acquires a target, then
set its width = distance between the tower and the enemy, and set its angle toward the enemy.
When the enemy is out of range = turrets unacquire that enemy and so the 'lifedrain' is destroyed.
Turrets is then targeting the next enemy in range.
It seems like working fine when there is one enemy on the layout . It still spawns the 'lifedrain',
set width and angle toward the enemy but still got a small issue when it is at the overlapped
zone between the two turrets' ranges.
Also when you spawn an enemy at the bottom right corner, the lower turret still spawned the 'lifedrain',
but it wasnt destroyed when the enemy left the range.
Main problems appear when there were more than one enemies on the layour,
the turrets spawn multiple lifedrains, some of those would target the out-of-range enemies,
the extra lifedrain were not destroyed or so.
I might not have the right approach it right as I'm still on the learning process (and I love Construct 2, so far).
I has been stuck on this for a while so now I need some experts' touch here.