I am creating a tower defense game and I want to make a tower that shoots a bullet and every enemy that the bullet hits is damaged. The bullet can hurt multiple units. My problem is detecting if the bullet hits the enemies.
Right now, I have the enemies in an array. With other towers, when an enemy is in range, the tower fires and when it hits its original target, it causes damage to that target.
For the tower I want to make, it will shoot the bullet the maximum range every time and I need it to damage every unit it hits on the way to that final destination.
Anyone have any ideas on how best to do this? I been thinking it through for a while and haven’t come up with anything useful.
Is the challenge identifying where to aim the turret, or how to identify whether the targets on the line are struck?
For a example, a simple way to create the line might be: Turret targets first enemy in range, draw a line extending from turret through that enemy for the length of the turret range. In that case, the problem comes down to determining whether the current enemies are within acceptable range of the line.
If your problem is instead how to draw the line, perhaps you could clarify what part of the problem is an issue in particular.