Camera movement not fluent


(billy2000) #1

Hyas. I’ve been talking on IRC yesterday night and i came to think that the problem is that the camera is sticking to player.After some testings today i finally decided to check how would it look if i would make camera move each frame with 3 pixels.After doing that it still has that weird movement. So i was wandering if there is any way of solving it. The movement is something like this: Camera’s x is actually alright ,after checking how it moves each frame ,its always by 3 pixels.But All the images looks like they are stopping for 1 frame or so from like 2-3 frames to 2-3 frames.


(Bora Kasap) #2

If you’re updating your camera from “override render()”, then move your camera code in to “override update()” function.


(billy2000) #3

Well it is in override update…tried this in world and player’s class


(billy2000) #4

Now that i look more games have something like this. Here is a example of a game with same problem …found on miniclip

Is this a flash problem …or can it be solved in some way?


(Zachary Lewis) #5

It could be a framerate issue (the game takes longer to update on one frame, so the game moves the camera twice as far to compensate for the missing frame), a rounding issue (on one update, the camera goes from x=1.45 to x=2.53 causing the camera to appear to jump from x=1 to x=3) or a combination of both.

Try using the :arrow_right: button in the console to step the game forward one frame at a time and see if the camera is jumping. You can also set a watch on the camera’s x and the player’s x to make sure things are copacetic.


(billy2000) #6

Well i tried this and the camera is not jumping. Also it is exact same thing when i try to make camera add a int number every frame. Still looks jumpyish.


(Zachary Lewis) #7

Then it’s a framerate issue, my man.


(billy2000) #8

oh ok then ._., thx for tips tho :smile: