Intercepting a moving target in ActionScript 3.0

by Joseph Hocking

As an exercise to practice spatial and AI programming, I devised a simple algorithm to correctly hit a moving target. In the interactive demo below the cannon constantly aims correctly to hit the missiles raining down. Press any key to fire a shot and watch it hit the missile (you may need to first click in the window for focus).

return to flash page

return home