Open Croydon opened 9 years ago
Thats super easy do a reject on the ray vector.
float buffer = 5;
//buffer should be how close you want the bullet to be to have to be before it plays a sound
//aka chinmusic.
if( hit a player)
{
}
else if(! player->o.reject(bullet->start, player->width + buffer))
//reject will basically check to see if the object is heading in the direction of a player
{
//play sound
}
that will work as kinda a hack, you could make it better by doing and intersect from the players -x x -y -y and see where the conection point is, then see how close that is. This would be much faster though :+1:
Original requested by @koppiman in https://github.com/inexor-game/data/issues/10: