function love.load()
char1 = love.graphics.newImage("images/alpha.png")
char1x = 0
char1y = 0
end
function love.update()
if love.keyboard.isDown("right") then
char1x = char1x + 1
elseif love.keyboard.isDown("left") then
char1x = char1x - 1
elseif love.keyboard.isDown("up") then
char1y = char1y - 1
elseif love.keyboard.isDown("down") then
char1y = char1x + 1
end
end
function love.draw()
love.graphics.draw(char1, char1x, char1y)
end
function love.load()
char1 = love.graphics.newImage("images/alpha.png")
char1x = 0
char1y = 0
end
function love.update()
if love.keyboard.isDown("right") then
char1x = char1x + 1
elseif love.keyboard.isDown("left") then
char1x = char1x - 1
elseif love.keyboard.isDown("up") then
char1y = char1y - 1
elseif love.keyboard.isDown("down") then
char1y = char1x + 1
end
end
function love.draw()
love.graphics.draw(char1, char1x, char1y)
end
I think because you have char1y on the left side and char1x on the right side.
Try changing to:
You should be using dt when moving your character around.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
I'm guessing the framerate of your game has been capped at 60 (thanks to v-sync), so you'll probably want to set speed to 60 to get a similar effect to what you were getting before: