T-Bone wrote:While your post doesn't quite make it clear exactly what the problem is, it sounds like you're sending positions (of enemies and such) in pixel coordinates. Don't do that! Anything going over a network should be in resolution-independent coordinates that work on any client.
Yeah, that's probably my issue. Any tips on how to fix the issue?
These are snippets of my code, I'm not asking for you to change it for me, but just let me know why it's wrong (obviously using l.w.getWidth is one thing) and all positions are scaled on drawing, never during update functions.
My code for enemies (using cron for the timer):
Code: Select all
enemyclock = cron.every(cron_time, function() newenemy(love.math.random(5, (love.window.getWidth()/scale)-32), 0) end)
and all bosses position themselves in the center of the screen, so for example the first boss:
Code: Select all
boss:new((love.window.getWidth())/2-(bossimg:getWidth()*scale)/2, -60)
who moves around left and right a lot.
Yeah the code looks pretty bad, but it's old from around the first few revisions of the game.