Michael M. answered 08/03/22
Game Programmer and programming hobbyist
I think you're trying to calculate what angle to aim the tower, you want the bullet to intercept the enemy, which they are both moving at different speeds.
You could do the easy thing: heat-seek (move towards target point each frame)
Or the easier thing: when the tower "shoots" just instantly damage the target
Or you could do the hard thing: shoot a bullet that intercepts the target. It's not a simple problem. The speeds would be constant, so you'd just calculate the position if the path were a straight line, then apply the distance from the target start to the target end onto the path.