How do I: Teleport Between Platforms

Just started using Construct 2? Post your questions here

Post » Sat Nov 01, 2014 10:21 pm

Hello all!

I have a question regarding teleporting back and forth between 2 platforms. They are both named sprites with images and no other behaviors. I named them simply Warp1 and Warp2. My player object is also a sprite named Player with an image(png) and just the Platform movement behavior.

My code is simple;

Condition(s)-On Key Pressed(Space Bar), Player Is Overlapping with Warp1
Action: Player Set Position to Warp2

Condition(s)-On Key Pressed(Space Bar), Player Is Overlapping with Warp2
Action: Player Set Position to Warp1

The code works fine when only one of them is active but I'm running into an issue when I try to warp while both sets of code are active. I press space on Warp1 and just end up in the middle of Warp1 (same thing with Warp2).

Am I missing something obvious here? Its probably right in front of me.
B
3
Posts: 2
Reputation: 179

Post » Sat Nov 01, 2014 10:52 pm

There are many ways to solve this...
try with a simple delay...

Condition(s)-On Key Pressed(Space Bar), Player Is Overlapping with Warp1
Action: System Wait 0.5 seconds
Player Set Position to Warp2

Condition(s)-On Key Pressed(Space Bar), Player Is Overlapping with Warp2
Action: System Wait 0.5 seconds
Player Set Position to Warp1
Image
B
63
S
23
G
7
Posts: 1,480
Reputation: 10,796

Post » Sat Nov 01, 2014 11:01 pm

Ah, that worked! Thankyou!
B
3
Posts: 2
Reputation: 179


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests