Page 1 of 1

Hey guys, collision issues here.

Posted: Mon Dec 24, 2012 1:04 am
by tommyroyall
Hey guys, sorry, I posted this in the wrong forums, please move or delete.

Hey, so I made a simple game, and I create objects like this:

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)
And I create blocks with a function, called:

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
Now, there's no issues with the variables as far as I know, but what would cause them to simple not register as colliding? Also, do I need to do anything with the world:setCallbacks()? I used it, seems kind of useless . . .

Re: Hey guys, collision issues here.

Posted: Mon Dec 24, 2012 1:08 am
by tommyroyall
I just realized I posted this in the wrong forum x_x . . . sorry.