Code: Select all
objects.player={}
objects.player.body=love.physics.newBody(world,SPAWN_X,SPAWN_Y,'dynamic')
objects.player.shape=love.physics.newCircleShape(25)
objects.player.fixture=love.physics.newFixture(objects.player.body,objects.player.shape,1)
objects.player.fixture:setRestitution(0.9)
Code: Select all
function addBlock(x,y,state)
blockcount=blockcount+1
x=x*METER
y=y*METER
block_width=METER
block_height=METER
objects.block[blockcount]={}
objects.block[blockcount].body=love.physics.newBody(world,x,y,state)
objects.block[blockcount].shape=love.physics.newRectangleShape(block_width,block_height)
objects.block[blockcount].fixture=love.physics.newFixture(objects.block[blockcount].body,objects.block[blockcount].shape,1)
end
Also, I didn't supply a .love because this is a fairly large/complex project, and collision just magically died -_-. If you want it though, I will post it.