Won't register a picture as a shape?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
GloriousDerp
Prole
Posts: 6
Joined: Tue Feb 25, 2014 10:52 pm

Won't register a picture as a shape?

Post by GloriousDerp »

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
bobbyjones
Party member
Posts: 732
Joined: Sat Apr 26, 2014 7:46 pm

Re: Won't register a picture as a shape?

Post by bobbyjones »

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Google [Bot] and 0 guests