How do I make a teleprt

0 favourites
  • 5 posts
  • I'm trying to make a mechanic where the character moves to a tapped spot and only when its a tap, does any enemy in the way get hurt. kind of like dark slash

  • I guess you'd only have to change the moveto example shipped with construct a little bit to get the basics of this..

  • I'm trying to make a mechanic where the character moves to a tapped spot and only when its a tap, does any enemy in the way get hurt. kind of like dark slash

    Set the player's position to Touch.X and Touch.Y in the "on tap" condition. Then create a sprite between the player's old position and his new position, rotate it accordingly, then check for collisions with each enemy and apply damage to them.

    First time I hear about Dark Slash, seems like a nice game. Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Zed2100 what if I want my player to speed to where I touch? Is there a ways to do it using the Bullet behavior

  • Rather than using the Bullet behavior, you can do that more easily IMO using the event sheet :

    Set your player's angle toward the touch position, then use the "move forward" action. Set the distance to the speed times dt.

    This will move the player at constant speed, if you want an accelerated movement I would implement it using the mathematical formula for acceleration and deceleration, or you can use the CustomMovement behavior to achieve that.

    In my implementation, I would create a sprite for the player character and pin it to my (invisible) player object (which will be rotated). It is usually a good idea to do this separation, however, you can avoid rotation by using something like "move at angle" where the angle is computed between the touch position and your player's position (use the angle system expression to get the angle between two points).

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