Won't register a picture as a shape?
Posted: Fri Feb 19, 2016 3:54 pm
I am trying to make the player(burgah) be a dynamic character, but i cannot attach burgah.body and burgah.shape with a fixture because burgah.shape is a picture. Is there any way to fix this?
Code: Select all
function love.load()
love.graphics.setBackgroundColor(255, 255, 255)
love.physics.setMeter(128)
world = love.physics.newWorld(0, 5000, true)
background = love.graphics.newImage("pictures/backgorund.png")
x = 100
y = 100
burgah = {}
burgah.body = love.physics.newBody(world, 5, 10, "dynamic")
burgah.shape = love.graphics.newImage("pictures/burgah2.png")
burgah.fixture = love.physics.newFixture(burgah.body, burgah.shape)
end
function love.draw()
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw(burgah.shape, x, y, 0, .8, .8, 0, 0)
end