Hi,
It is been days Im trying to figure this problem out so I tought it would be a good idea to ask for some help here if you dont mind ^^
Thanks you very much in advance and sorry for my broken english, it is not my mother tongue).
I move my sprites using integers and pointclamp, after google search I have found nothing on this. Most of the issues where from people using floats or double to store positions.
I apply velocity to world position i and j then I convert this into screenposition.
destination.Width = entity.body().scaledWidth;
destination.Height = entity.body().scaledHeight;
destination.X = entity.body().x;
destination.Y = entity.body().y;
source.Width = scene.texture(entity.visual().texture).framesize;
source.Height = scene.texture(entity.visual().texture).framesize;
source.X = scene.texture(entity.visual().texture).sx(entity.visual().frame);
source.Y = scene.texture(entity.visual().texture).sy(entity.visual().frame);
- X, Y, SCALEDWIDTH and SCALEDHEIGHT are screencoordinates
- I, J, WIDTH and HEIGHT are worldcoordinates
is basically what I draw using
spritebatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, DepthStencilState.Default, RasterizerState.CullNone);
I tried to disable my camera but I also got the blurry sprites when it moves. The problem doesnt seem to be related to the camera transforming the coordinates.
The sprite moves like this
private void up() { body().j -= body().velocity; }
private void down() { body().j += body().velocity; }
private void left() { body().i -= body().velocity; }
private void right() { body().i += body().velocity; }`
It is all integers. No float, no decimals, etc…
Do you have any idea what would be causing the problem ?
If you need more code I can provide it, I just dont know what parts you need to figure this out.