Hey, thanks for this wonderful visible true/false thing.
Also, can I make my physics body visible/invisible too?
If so, then I should have know this…
Also, by default, my those sprites are colliding and handled automatically by chipmunk without any collision callback.
So, if I need to use your way, which is to spawn those physics sprite(with physics bodies attached buy inivisible),
hope this won’t be handled automatically by chipmunk. I mean, hope it does not remain away out of my physics box because they’re colliding with its boundaries. !!!
And, ya. Actually my way is not so good. I mean, since I was having very very few physics sprite just 2 when I was to spawn those physics body sprites. And also there were random forces on existing physics sprites in my physics box.
So, it was very less probability that they will have same position at the time of spawning just 5 more new.
I played my game 25-40 times. And it never happened strange motion. So, this was fine with my case and moreoever it was my first game.
Also, the best solution for my case is only to find the empty region in the scene.
Which I guess could be done using iterating a dummy box of size half of the physics sprite and then shifting it by half the size of sprite in x axis and y axis (So, 2 for loops), and then checking whether this rectangle of my existing sprites in the scene contains the points in my dummy rectangle…
This should have worked, but I couldn’t use before submitting my game because the I got late reply of using that API to check boolean of rectangle within rectangle.
Anyways, I would be happy if you reply to my 2 questions/doubts in this post…