Code: Select all
for k, v in pairs(server.playerData) do
love.graphics.circle("fill", v.x, v.y, 50) -- Draw player graphic exactly at position
end
Code: Select all
for k, v in pairs(server.playerData) do
love.graphics.circle("fill", v.x, v.y, 50) -- Draw player graphic exactly at position
end
Maybe tweening between position A and position B? This could also look weird. But if you allow movement only in certain directions, then also approach suggested above, taking direction and speed in account, could work.Sammm wrote: ↑Tue Aug 08, 2023 10:21 pm Hello! I've created some basic multiplayer movement code, but right now everything looks super jittery. My code to draw clients is basically just:
I'm using a physics engine so I can't simulate the client in real time, since everything that moves is variable. I just need to figure out how to add some basic interpolation or something so that the movement of other clients and entities can be smoothed out. I've looked for a ton of sources already but everything I saw uses Unity or has some long winded approach that I believe is overkill for such a simple game I'm creating (a 2D platformer dodge game). If someone could perhaps demonstrate some simple pseudo code or at least point me in a reasonable direction to go forward with implementing this, I would greatly appreciate it!Code: Select all
for k, v in pairs(server.playerData) do love.graphics.circle("fill", v.x, v.y, 50) -- Draw player graphic exactly at position end
Users browsing this forum: Bing [Bot] and 3 guests