MasterLee wrote: ↑Fri Mar 17, 2017 5:20 pm
Are you reacting on any mousemoved events? In haXe i noticed somethings goes slow when reacting on mouse move on Windows.
function love.keypressed(key)
love.keyboard.setkeyrepeat(true)
local dt = love.timer.getDelta()
if key == "d" then
player.x = player.x + player.spd + dt
end
end
function love.keypressed(key)
love.keyboard.setkeyrepeat(true)
local dt = love.timer.getDelta()
if key == "d" then
player.x = player.x + player.spd + dt
end
end
One, you should multiply the speed with dt, not add dt to it.
function love.update(dt)
if love.keyboard.isDown('d') then
player.x = player.x + player.spd * dt
end
end
?
Also, that keyrepeat thing is unreliable; for example, it doesn't work on my computer because i disabled it. I wouldn't base any timing stuff on it.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
function love.keypressed(key)
love.keyboard.setkeyrepeat(true)
local dt = love.timer.getDelta()
if key == "d" then
player.x = player.x + player.spd + dt
end
end
One, you should multiply the speed with dt, not add dt to it.
function love.update(dt)
if love.keyboard.isDown('d') then
player.x = player.x + player.spd * dt
end
end
?
Oh. Im sorry. I meant to multiply that, just made a typo. Ive tried that in the update function, but for some reason, instead of the player moving, its teleporting
yetneverdone wrote: ↑Sat Mar 18, 2017 5:37 am
Oh. Im sorry. I meant to multiply that, just made a typo. Ive tried that in the update function, but for some reason, instead of the player moving, its teleporting
It shouldn't. Post your project.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
yetneverdone wrote: ↑Sat Mar 18, 2017 5:37 am
Oh. Im sorry. I meant to multiply that, just made a typo. Ive tried that in the update function, but for some reason, instead of the player moving, its teleporting
It shouldn't. Post your project.
Ive tried doing that in the class Player update, in that it causes the teleportation. After trying it on the main love.update, it works.
IDK why is that. Anyways thanks for the help. Ill check later if it fixes the issue with the window machine