I was reading about steering behavior and thinking about best way to implement it and I realize that pursuit may be used for predictive aim.
1. calculate lookahead value - distance/total speed: a)for enemy total speed is player.speed + enemy.speed, b)for bullet total speed is player.speed + enemy.speed + bullet.speed
2. predict future position of target: a) player.position + player.velocity * lookahead
3. fire bullet at bullet lookahead/add velocity in direction of enemy lookahead
hold left mouse button for enemy to start to move
(at first if i set enemy to follow its lookahead he complitly disappeard...but now for some strange reason everything works well)
events are mess, my english too
Pursuit and pursuit based predicitive aim
capx