Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sf::IntRect tileRect;
- tileRect.left = ( pos.x - ( getBoundingBox().width / 2.f ) ) - 2;
- tileRect.top = ( pos.y - ( getBoundingBox().height / 2.f ) ) - 2;
- tileRect.width = getBoundingBox().width + 4;
- tileRect.height = getBoundingBox().height + 4;
- // I don't remember what these were for. Probably for checking if there was a collision
- sf::Vector2i vertCol( -1073741824, -1073741824 );
- sf::Vector2i horCol( -1073741824, -1073741824 );
- for ( int ix = tileRect.left; ix < tileRect.left + tileRect.width; ix++ )
- {
- for ( int iy = tileRect.top; iy < tileRect.top + tileRect.height; iy++ )
- {
- // Stuff
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment