• 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!

Parallax Effect BUT with preserving offset

Hy guys, I'm currently working on a space game with parllax effects but I need to know how can I preserve the bg layer offset in the parllax view.
I'm using this code:
var _cam_x = camera_get_view_x(view_camera[0]);
var _cam_y = camera_get_view_y(view_camera[0]);

layer_x("Background",_cam_x * 1);
layer_y("Background",_cam_y * 1);

layer_x("Star01",_cam_x * 0.8);
layer_y("Star01",_cam_y * 0.8);

layer_x("Planet01",_cam_x * 0.3);
layer_y("Planet01",_cam_y * 0.3);
 
Top