0 Favourites

Teleport player?

  • I want to create a way for the player to teleport a certain distance, which is simple enough. The issue arises when there's a wall in the way. I want to check for a wall before the teleport happens so that it won't work if the player will get trapped in there. Additionally, if the wall is low enough (such as a small raised platform), I want the player to teleport to the top of it rather than inside of it. If the wall is too high, nothing will happen.

    I suppose the basic question is how do I check whether or not a wall is in a certain proximity to the player? If the wall is there, the teleport should be disabled, unless it's a relatively short height.

    Additionally I'd like to be able to check whether there is a floor where the player teleports (if there isn't a floor where the teleported player would land, it should not work there).

    If you've ever played MapleStory, certain characters have teleport which is almost precisely what I'm looking to do. The chief bandit's assaulter skill is also really close to what I intend to do. Thanks in advance for any help!

  • First thought (not checked)

    Just create an "empty" (invisible - but maybe with some effects to show a failed attempt ? ) sprite where you want the player to teleport to - is this overlapping a wall then destroy empty sprite and forget teleport - you could extend this basic idea to check for floor and move up to top of wall if necessary.

    You could do this check with using the overlap at offset ?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Here is something to give you a start - might not be the best way to go about it though

    teleport test 01

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