# Thinking with portals in Construct 2.

Get help using Construct 2

### » Sun Apr 21, 2013 8:28 pm

I don't think I will use this. but you know, I can.(WE can!)
Portal. Some mechanics there are hard to be done in Construct. I will just put a list of these mechanics.
1. Momentum. Say, we have 2 portals that can teleport to each other. The player, when going somewhere or falling will have some momentum. How can we save that momentum when going into another portal? The use of physics here makes me go
2. Looking into portals. If you look at a portal, you will see what is going on the other side of the portal. Is there any way to use cameras that show their surroundings in a window?
3. The teleporting itself. The teleporting by itself is not a giant problem(SET POSITION TO XX DUH DUH Y BLAH), but combined with momentum and camera problems it will require lots of thinking, if not updating the whole Construct 2.
Just google if you don't know what Portal is, it's a video game
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,362

### » Sun Apr 21, 2013 9:39 pm

This might be useful: http://physicswithportals.com/
B
82
S
21
G
15
Posts: 1,038
Reputation: 15,092

### » Tue Apr 23, 2013 1:06 am

2.Maybe using Rojos canvas plug you can do something mystical and solve this, other then that i'm not to sure how to achieve this (also i'm to lazy to think of anyway to accomplsh this lol)

3.For momentum all you really have to do is store a value for player speed (velocity if your going in different directions) times the mass, when the player collides with a portal. Then add another value such as the "fall distance" to the stored value and a physics impulse when the player exits the portal.

So lets say you jumped off a cliff and landed on a portal, well I guess as the player is falling down, a global variable called "fall" would add 1 to itself until the player hits the portal. Then when the player collides with the portal, the variable stops adding 1. A physics impulse is then placed on the portal after the player changes to the new portal position, assuming we use one of newtons law then the force applied to the player plus the fall down variable, we should get some kind of force acting on the player and pushing it a bit higher depending on the impulse plus the momentum gained when falling.

It is kinda tough but definetly not impossibleretrodude2013-04-23 01:09:12
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

### » Tue Apr 23, 2013 1:08 am

If your not sure how to store variables then post it here, and i'll help you out
B
18
S
4
G
3
Posts: 436
Reputation: 4,801

### » Tue Apr 23, 2013 2:28 am

Did you check out the FAQ ? I remember an example of this ...
B
34
S
16
G
16
Posts: 2,222
Reputation: 16,564