Stewart Evans
Member
I've seen some issues with this in other threads, but nothing I've tried has worked. Basically, when the camera doesn't move everything looks fine, but when it does and I'm moving diagonally my character shakes slightly, which is of course unwanted.
Step Event
Draw Event
The camera is set to follow the player's x and y coordinates. Camera's set view code in the step event
I've tried flooring my x and y positions of my player, and while it no longer shakes, it causes my diagonal speed to be too fast.
Any help I could be very much appreciated.
Step Event
GML:
inputDirection = point_direction(0, 0,keyRight - keyLeft, keyDown - keyUp);
inputMagnitude = (keyRight - keyLeft != 0) || (keyDown - keyUp != 0);
hSpeed = lengthdir_x(inputMagnitude * speedWalk, inputDirection);
vSpeed = lengthdir_y(inputMagnitude * speedWalk, inputDirection);
x += hSpeed;
y += vSpeed;
GML:
draw_sprite_ext(sprite_index, image_index, floor(x), floor(y), image_xscale, image_yscale, image_angle, image_blend, image_alpha);
GML:
camera_set_view_pos(cam, floor(x) - viewWidthHalf, floor(y) - viewHeightHalf);
Any help I could be very much appreciated.
Last edited: