Puzzlem00n wrote:You're not using dt, huh? You have no idea how fast that makes the games run on my machine. You really need to factor this in, it's basic LÖVE, although I can see why you'd think it's safe to ignore.
What do you mean? Where to use dt?
i have update (dt)...
clepto wrote:
What do you mean? Where to use dt?
i have update (dt)...
the dt in update( dt ) only says the update loop " hey man, you need dt in your loop !! ".
use dt with values you increase / decrease in your love.update. i.e for the player movement:
function love.load()
player.x, player.y = 0, 0
player.xvel = 200
end
function love.update( dt )
if love.keyboard.isDown( "right" ) then
player.x = player.x + player.xvel * dt -- xvel is the speed on the x axis
end
end
This let your game run with the same speed on every computer.
Have you read the wiki, or did you just skip ahead thinking you knew programming already? (Seems like you must have used some other language in the past, unless you copied and pasted all that code.) Well, love2d is different. I'm trying not to be to mean, but we really shouldn't have to be telling you this, it's fundamental. You should read a tutorial, literally any tutorial, before going forward. Try this: https://love2d.org/wiki/Tutorial:Gridlocked_Player