magnum00125
Member
Here we go again
I am creating a parallax background for my game, and I know how to make the background follow the player around. The background jumps around with oPlayer, which of course looks unrealistic.
The code I am currently using to position my background sprites (code in oBackground that I drop into my room):
layer_x("Backgrounds_2", oPlayer.x / -1.5);
layer_x("Backgrounds_3", oPlayer.x / -3);
layer_x("Backgrounds_4", oPlayer.x / -6);
layer_x("Backgrounds_5", oPlayer.x / -9);
layer_y("Backgrounds_2", oPlayer.y-160);
layer_y("Backgrounds_3", oPlayer.y-160);
layer_y("Backgrounds_4", oPlayer.y-160);
layer_y("Backgrounds_5", oPlayer.y-160);
Very basic.
Is it possible to stretch a background to fit the viewport and follow the viewport when moving the player object around in GMS2?
I am creating a parallax background for my game, and I know how to make the background follow the player around. The background jumps around with oPlayer, which of course looks unrealistic.
The code I am currently using to position my background sprites (code in oBackground that I drop into my room):
layer_x("Backgrounds_2", oPlayer.x / -1.5);
layer_x("Backgrounds_3", oPlayer.x / -3);
layer_x("Backgrounds_4", oPlayer.x / -6);
layer_x("Backgrounds_5", oPlayer.x / -9);
layer_y("Backgrounds_2", oPlayer.y-160);
layer_y("Backgrounds_3", oPlayer.y-160);
layer_y("Backgrounds_4", oPlayer.y-160);
layer_y("Backgrounds_5", oPlayer.y-160);
Very basic.
Is it possible to stretch a background to fit the viewport and follow the viewport when moving the player object around in GMS2?