How to make an object move to another object's image point?

0 favourites
  • 4 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • I'm trying to make a complex enemy that involves throwing their sword, then moving to that sword's position.

    My attempted method at doing this was have the enemy sprite spawn a sword sprite on them, and then have the sword sprite move to a separate image point on the enemy sprite. Doing it this way would just fix all the issues I'm having for the desired effect, and make the event tuning much less complicated. Can it be done?

    All I was able to do was make the sword sprite teleport instantly to the enemy sprite's image point, or have it rotate and set it's angle to the point.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Look up imagepoints. You can add them to sprites and refer to their X and Y positions. I would suggest to follow a beginners tutorial like the Ghost Shooter if you haven't already

  • Edit: can't post links, yolo.

    sprite1.ImagePointX("pointA") is what you'd want to get from that. You'll have to set an acceleration or speed on the sword to actually get it to move from there, and figure out a way to make it stop after a certain distance or on collisions.

    Where pointA is the name of the imagepoint. By default this is named to an integer, but you can be more descriptive. You may have to change a few things with how the sword is bound to the enemy to get this to function properly. In other words, you can't use system>every tick anymore (I think). I'm new at this, but the simplest solution is to have a boolean toggle whether the sword is in the thrown state, and keep it bound to the enemy if it is not, and have it do the throw functions when it is.

  • That's exactly what I needed to know, thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)