In my game , the stones are sent and if it hits the bird , bird dies , stone child is removed and when bird is out of screen , the bird child is removed. However, sometimes stone doesnt hit the bird but stone is being removed and after few seconds game gives eror and says "The supplied Sprite must be a child of the caller.stack traceback:". There isnt bird and game tries to remove bird. It is complicated. I have been trying to work out that problem for 4 hours. Help please
Comments
At least try to explain how are you implementing bird moving, stone throwing and collision detection.
if self:hitTestPoint(stone:getx(),stone:gety())... What can i use to control all of this stones?
you are using self:hitTestPoint for collision detection between bird and stone?
Problem is, that well, you actually use only 1 pixel from stone for collision detection, not all stone perimeter.
Do you use physics in your class? Is bird a box2d object?
now you'd need to implement your own collision detection depending on shapes of your objects.
Most basic would be to use square area surrounding object and hitTestPoint method.
http://giderosmobile.com/forum/discussion/121/simple-collision-detection#Item_2