Teleport player?

Get help using Construct 2

Post » Mon Jan 27, 2014 9:41 pm

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!
B
5
S
1
Posts: 15
Reputation: 341

Post » Tue Jan 28, 2014 9:31 am

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 ?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812

Post » Tue Jan 28, 2014 10:03 am

Here is something to give you a start - might not be the best way to go about it though

teleport test 01
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812


Return to How do I....?

Who is online

Users browsing this forum: alextro, georeb, ivanski1983, Ryan Kocourek and 7 guests