How do I move a sprite to a specific location?

0 favourites
  • 2 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • I'm trying to make a simple AI for a sprite. I just want to have it move a particular distance in a straight line. (Which could also be specified as moving to a particular location.)

    I've tried an 8 Direction behavior and the "simulate control" action, but it seems much too limited. For example, I'd need to be able to tell it when to start moving and when to stop moving. But the "simulate control" only seems to work when associated with a continuous input, such as a "is touching object" condition. I can't find any way to tell it to simply start moving and then keep moving until it reaches a particular destination.

    I've also tried using a Pathfinding behavior, but it seems to have the opposite problem. It's far more complicated than I need. The requirement to start a path calculation in one place and then pick up the completion event in another is a bit convoluted. All I need it to do is move in a straight line.

    I've also tried using the Bullet behavior, and I can get it to start moving just fine. But I can't figure out how to get it to stop. More specifically, I can't figure out how to monitor its position to tell it when to stop. A "while" loop executes immediately and goes infinite because it never gives the sprite a chance to move.

    I'm guessing there must be a simple way to do such a simple thing, but I've been at it for hours and I just can't sort it out. Any help would be greatly appreciated.


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)