How do I synchronize layer position

Get help using Construct 2

Post » Sat Jan 09, 2016 9:17 pm

Message: yosi1202 is not yet permitted to post plain text URLS (300 rep required). 2 URLS removed. Why?
I am having my player moving between 2 layers with parallax, the problem is that when my player moving to the other layer
he does't stay in the same place, that is because the x = 100 on layer 1 and x = 100 on layer 2 are not is the same place
that is ok and is because of the parallax, but how can I move my player to layer 2 and keep it in the same visual place?

images of the problem:thanks in advance
Posts: 1
Reputation: 179

Post » Tue Jan 12, 2016 9:37 pm

You should be able to use the LayerScale's for each layer to transform his position into the absolute reference frame before transforming it into his new layer's reference frame.

I am not 100% how this math would go, but something like:

NewPlayer.X = Player.X / LayerScale("Layer 1") * LayerScale("Layer 2")
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
Posts: 1,419
Reputation: 4,867

Return to How do I....?

Who is online

Users browsing this forum: Metathronos and 8 guests