Hello,
I'm developing a World War II shooter. Look at this screenshot:
The red line represents where the bullet of the rifle will go. Due to low FPS when trying an actual bullet approach, I've gone with a hitscan approach.
Here is where the problem comes in: I don't want my bullet to go through solid blocks. The first step in coding this is to find where the bullet will actually
go. My typical method of collision detection (create rects of the 2 objects that might collide, compare their edges) won't work, since I'm dealing with a line (actually a thin, rotated sf::RectangeShape, but anyways), not a box. What I need is a way to rotate a sf::Rect so it would fit the profile of the line.
Is there a way to do this? Other solutions are also appreciated.