Q
Quinton LeBlanc
Guest
I've searched high and low for a solution to this issue, and I'm not experienced enough to tinker with things like this myself. I am trying to make the background scroll by to give my game more of a 3D effect. But when my character moves, or stops moving, the elements of the background move choppily. Even the sun, which is supposed to stay static is stuttering for absolutely no reason whatsoever. It SHOULD work.
Here is the code inside of my camera objects create event
essentially creating the camera. As you can see I am using Pixelated Popes display manager to essentially scale my game up to multiple resolutions. Resolution isn't the issue here as I have the game running at 2x resolution and am still getting this issue.
here is the code inside my camera's step event
This smooths the cameras movement, so the cameras starting and stopping is not instantaneous.
This is the code inside of my camera objects end step event
Here is the choppiness in action. look at how it jumps around, especially when my character and the camera slows to a stop.
Here is the code inside of my camera objects create event
Code:
///Camera Creation
global.camera = camera_create_view(x, y, o_global_displaymanager.ideal_width, o_global_displaymanager.ideal_height, 0, self, -1, -1, 275, 275);
view_camera[0] = global.camera
for (var i = 1; i <= room_last; i++) {
if (room_exists(i)) {
room_set_camera(i,0,global.camera)
room_set_viewport(i,0,true,0,0,o_global_displaymanager.ideal_width,o_global_displaymanager.ideal_height)
room_set_view_enabled(i,true);
}
}
here is the code inside my camera's step event
Code:
///Smooth Camera
x += (o_plyr.x - x) * .1;
y += (o_plyr.y - y) * .1;
This is the code inside of my camera objects end step event
Code:
/// Parallax Backgrounds
// Define layer IDs
var layer_id1 = layer_get_id("back");
var layer_id2 = layer_get_id("mid");
var layer_id3 = layer_get_id("front");
layer_x (layer_id1, lerp(0, camera_get_view_x(view_camera[0]), 1));
layer_x (layer_id2, lerp(0, camera_get_view_x(view_camera[0]), .75));
layer_x (layer_id3, lerp(0, camera_get_view_x(view_camera[0]), .25));