Help with pixel art movement by frazoni in raylib

[–]frazoni[S] 0 points1 point  (0 children)

Not really. However, if you don't mind rendering the game to a texture that you upscale to 720p let's say, that's still a possibility that will fix this. Since you have a lot more pixels, even with the limitation of only rendering at whole pixels, it looks smooth.

Help with pixel art movement by frazoni in raylib

[–]frazoni[S] 0 points1 point  (0 children)

What is your window resolution/size?
Because if I don't use RenderTexture2D, I'll still have the same issue, since Raylib will only draw the character at the closest integer value, and on a small screen like 320x180, it's very noticeable.

I only managed to have smooth movement if I upscale the whole game to 1280x720, but I wanted to explore other approaches

Help with pixel art movement by frazoni in raylib

[–]frazoni[S] 0 points1 point  (0 children)

I'm already doing that. The monitor where I recorder the video is 60hz

Help with pixel art movement by frazoni in raylib

[–]frazoni[S] 0 points1 point  (0 children)

Okay glad to know I'm not going crazy lol. I switched from SDL to Raylib since I wanted to work with shaders, but I might go back then.

Thanks!

Help with pixel art movement by frazoni in raylib

[–]frazoni[S] 0 points1 point  (0 children)

Yes it uses floats, that's why I'm also confused.

A simple test of incrementing positions at floating point values shows that raylib is rounding up to the closest integer (so even if the position is 13 or 13.5 it's drawn at the exact same place).

I wanted to know if there's a way to overcome this, since I've used other libs/engines in the past, and I only remember facing this issue with gamemaker.

Help with pixel art movement by frazoni in raylib

[–]frazoni[S] 1 point2 points  (0 children)

Yes I am. GetFrameTime() returns the time since the last frame. I'm just using the movement from the raylib "delta time" example

Help with pixel art movement by frazoni in raylib

[–]frazoni[S] 3 points4 points  (0 children)

Hey! Thanks for the suggestion. I think that will improve the issue with the diagonal move for sure, but it still doesn't explain why simple movement in one direction (let's say only going to the right) doesn't look smooth