Page 1 of 1

a bouncing ball example for comment and questions

Posted: Wed Oct 08, 2014 6:23 am
by timeislove
hello, this is my first take.

it uses the physic module to mimic balls and enemies.

question below:

1. ball and enemy basically use the same code, just the enemy uses a chain shape while ball use circular shape. why the collision callback could not capture any inter collision between enemies?
2. checkBall and checkEnemy to check and remove those objects have reached 'dead' state. i suppose this checking should **ONLY** be within love.update, however, it seems that the collision callback would be called even when the update is being called, hence it break the system when indexing to those dead objects which have not removed yet! i have to add the checking in the collision callback to remove the dead object right after the collision take place. could u confirm my understanding is correct?! if so, why? (i.e. callback even another function is being called)
(you may comment out the two checking functions within the collision callback to see what i am talking about)

3. about the setmetric. it is said to map the pixel to the real world dimension. but for all those calls in physics module, they all refer to pixel coordinates. so, what is the real use of this metric stuff?

4. the concept of local coordinates and world coordinates. i see the conversion (copies from other sample) but not understand exactly what they mean to be... could explain to me more with examples? is the world coordinate the screen coordinates or even beyond that?!

tkyou!