• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

[SOLVED] Parallax Background doesn't stop when outside of room.

Drazglb.

Member
Hi guys, it's me again.
I'm having an issue with my parallax code.
Here is how the hole thing is set up; I have 3 background layers, each one follows at a specified speed my character's x position.

Code:
layer_x("layer1",clamp(o_char.x/2.5,0,room_width))
layer_x("layer2",clamp(o_char.x/2,0,room_width))
layer_x("layer3",clamp(o_char.x/1.5,0,room_width))
It works fine until I reach the room's boundaries. It moves strangely and it stops only when the character is outside the room. What I want is my "backgrounds" to stop when I my view can't move further to the left, or onto the right. Any idea? I tried with camera_get_view_x but it doesn't work either.
By the way, my Background layer's sprites have tile horizontal checked in.

Thank you for your answers in advance.
 

Drazglb.

Member
Alright, so it seems I am definitely an idiot.
This tutorial helped me, I just didn't see it before some others.
Sorry then!
 
Top