Select object, now follow where I tap...

0 favourites
  • 3 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hi everyone.

    First of all, super excited about Construct 2, and glad to see how helpful the community is around here. I've read through several threads in the forum, but unfortunately I'm still having problems figuring out a few basic things. Essentially, what I'm trying to do is first, is to have my "character" look right(if moving right) or left(if moving left) when I tap/click the screen. The concept is not a "Platform" like Mario Bros or Gianna Sisters, but rather Monkey Island or diablo, isometric.

    Yes, I did see the answer for the "diabloLikeMov.capx", but I have no idea how to recreate it as it makes little sense to me what everything does.

    Is there a simple way to achieve this?

    Thanks ahead of time.

  • The diabloLikeMov.capx works as follow :

    When you click anywhere on the screen (event 1) you set two variables of the collision box of the character to "where you want to go" (xTarget,yTarget).

    I also set a 'moving' boolean to true. It's like a flag that means "yeah now you move!"

    Basically I use these variable to drive the character.

    The event 2 just check if you are close or not to the target. It's to avoid imprecision problems. If you are less than 5px from the target, then stop ('moving' to false)

    The hardest part is probably the

    event 5 -> Collision: Set position to ....

    This event just move the collision sprite a little each tick toward the xTarget,yTarget position.

    All the other things are just to change the animation according to the direction of the movement. The "aPref' variable means 'animation prefix' ("B" for Bottom, "T" for Top, "R" for Right and "L" for Left plus 4 combinaison for diagonal movements)

    (I updated the diabloLikeMov.capx with some comments)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yann, thank you so much for your answer, really appreciate it. I'll be looking at the diablolikeMov again and see if I can recreate this.

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