SpriteLibrary
SpriteLibrary
SpriteLibrary
Sprite Class
Sprite Methods
MoveTo Method
MoveTo Method (List(Point))
MoveTo Method (Point)
MoveTo Method (Sprite)

# Sprite MoveTo Method (Sprite)

Move to where the destination sprite currently is at. This is a dumb move. It does not take into consideration the movement direction of the destination sprite. So the moving sprite does need to be moving a bit faster than the sprite you are trying to hit for it to do so.

Namespace: SpriteLibrary
Assembly: SpriteLibrary (in SpriteLibrary.dll) Version: 1.0.0.6 (1.0.0.6)
Syntax
C#
Copy

    public void MoveTo(
    	Sprite Destination
    )

#### Parameters

Destination
  Type: SpriteLibrary
  Sprite
  The sprite we are trying to hit

Examples
In this example we are creating a "heat seaking" missile that will find the target sprite, regardless of where it moves. The missile will move in a straight line from where it is to where the target sprite is, regardless of where the target sprite moves to. It readjusts the movement direction quite often, so it is very difficult to dodge. Use this only when you really want the thing to hit.
C#
Copy

    Sprite NewSprite = MySpriteController.DuplicateSprite("Missile");
    NewSprite.AutomaticallyMoves = true;
    NewSprite.PutBaseImageLocation(new Point(startx, starty));
    NewSprite.MoveTo(TargetSprite);
    NewSprite.MovementSpeed = speed;

See Also

#### Reference

Sprite Class
MoveTo Overload
SpriteLibrary Namespace