When i use sprite collision wont the transparent area produce the collision area. For example if my character collides with an object. The character colliding wont actually produce and effect if it collides with said object. When the transparent box collides with said object wont the effect be produced? Or is there some way to work around this. Like this:
(I saw on some other guys post that you dont like this code format but i cant figure out the other one so im sorry, this is what i learned at cplusplus.org ;/)
void collision(sf::Sprite character, sf::RectangleShape &enemy)
{
if(character.getPosition().x + character.getSize().x < enemy.getPosition().x ||
character.getPosition().x > enemy.getPosition().x + enemy.getSize().x ||
character.getPosition().y + character.getSize().y < enemy.getPosition().y ||
character.getPosition().y > enemy.getPosition().y + enemy.getSize().y)}
{
}
else
{std::Cout << "Collision" << std::endl;}
Wont character.getposition().x = The x including the transparent area. And wont character.getposition().y = the y including the transparent area? So when the transparent area colides with enemy it will cout collision instead of couting collision when the sprite inside the transparent area collides with enemy?