love2d / love

LÖVE is an awesome 2D game framework for Lua.
https://love2d.org
Other
4.87k stars 391 forks source link

Images #1827

Closed Roccooxd closed 2 years ago

Roccooxd commented 2 years ago

How do i put images in my thing (not game yet), i make sure the name is right and... i'm not very sure about the code, here is it function love.load() frame = newPaddedImage("frame_up.png") x = 0 y = 0 mv = 10 end

function love.draw() love.graphics.newImage(frame, x, y)

end

function love.update() if x > 600 then x = x - mv end if y > 400 then y = y - mv end if x < 0 then x = x + mv end if y < 0 then y = y + mv end if love.keyboard.isDown("d") then x = x + mv end if love.keyboard.isDown("s") then y = y + mv end if love.keyboard.isDown("a") then x = x - mv end if love.keyboard.isDown("w") then y = y - mv end

end Top

slime73 commented 2 years ago

This issue tracker is for bugs in love and suggestions for love's APIs, rather than being a support forum.

Roccooxd commented 2 years ago

oh, sorry

er2off commented 2 years ago
frame = love.graphics.newImage 'frame_up.png'
function love.draw()
  love.graphics.draw(frame, x, y)
end