public override void tick(ArrayList sprites, Sprite sprite, Game game)
{
if (target == null)
{
foreach (Sprite csp in sprites)
{
if (csp is TankSprite && csp != sprite)
{
target = csp;
}
}
}
int xinc = lookup[direction, 0] * velocity;
int yinc = lookup[direction, 1] * velocity;
x = x + xinc;
y = y + yinc;
if (target != null)
{
x = target.getX() + 10;
y = target.getY() + 10;
}
if (lifeTime-- == 0)
{
sprite.destroy();
}
}