Teleport

Get help using Construct 2

Post » Thu Feb 07, 2013 3:22 pm

My intention is to teleport my character 50 pixels to the right when you press a button. But then, I do not want to be stuck in a wall package. How I can detect if the character collide?

Thank you very much for the help :)

PS: Sorry my English.
B
1
Posts: 2
Reputation: 229

Post » Thu Feb 07, 2013 3:49 pm

There should be a function to execute as follows:
If object collides with wall on pressing "right" move object for 1 px to the left. Loop that event and you should just stand in front of the wall.
B
15
S
1
G
1
Posts: 37
Reputation: 888

Post » Thu Feb 07, 2013 5:01 pm

Unsure exactly what your needs are,but a couple of thoughts come to mind...

You could disable collision detection when the teleport is active re activating it when it is clear of obstruction..

Or have an invisable sprite generated 50 pixels away...that detects a "clear space" and only allows it when clear...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Thu Feb 07, 2013 6:13 pm

Thanks for the reply.

Like you I thought the ghost sprite. The problem is not how to detect whether or not that is colliding ghost.
B
1
Posts: 2
Reputation: 229

Post » Thu Feb 07, 2013 6:17 pm

Combining what the others said, you could turn off the sprite's collision, move to the right, then if the sprite is Overlapping a wall you move to the left each tick 'till it is no longer overlapping and re-enable collision.
B
6
S
1
Posts: 67
Reputation: 986


Return to How do I....?

Who is online

Users browsing this forum: agittm, mercuryus, mystazsea and 14 guests