mjaun / android-anuto

Another ugly tower defense for Android
GNU General Public License v2.0
213 stars 68 forks source link

Bullet Hose misses fast Fliers #151

Closed blackboxlogic closed 5 years ago

blackboxlogic commented 5 years ago

Bullet hoses sometimes miss fliers that are far away and traveling perpendicular. See bottom of image for clarity: image

I suggest changing the bullet speed, or teaching bullet hoses to aim slightly ahead of their target.

Or, is this "part of the game"?

mjaun commented 5 years ago

These towers are programmed to aim ahead based on the targets current speed. They might miss if the speed of the target is changing. But this looks more like a bug.

blackboxlogic commented 5 years ago

I don't see any 'aim ahead' code:

Shot.tick() seems to have bullets traveling in a straight line.

MachineGun.tick() seems to use the direction to the target's current location at fire-time.

Am I missing something? I might try to change MachineGun.tick() if I can get my computer set up for java dev.

mjaun commented 5 years ago

Sorry I was mistaken. It is the mortar which shoots ahead. But it probably makes sense to provide a similar mechanism here. Although it will be a bit more complicated to calculate, because the bullet travel time is not constant.

mjaun commented 5 years ago

Corrected in v0.5 (currently beta). The guns now aim such that the bullet will hit if the target keeps its current speed and direction.