How to check collision between two entities
Posted: Mon Jun 06, 2011 1:21 pm
as there are so many stuffs give for collision its quite confusing of wht to choose
i want that when two entities come in contact(just contact) at tht instance i want to decrease the health of character.
so this is wht i planned
if(body1.collideswith(body2))
{
body1.health-=1;
}
any way to get this logic
cause if i just check for collision, then till the time when the bodies r in contact ,health will reduce, but i want with one contact 1 health should reduce from the total.
i want that when two entities come in contact(just contact) at tht instance i want to decrease the health of character.
so this is wht i planned
if(body1.collideswith(body2))
{
body1.health-=1;
}
any way to get this logic
cause if i just check for collision, then till the time when the bodies r in contact ,health will reduce, but i want with one contact 1 health should reduce from the total.