Currently I have a vector that contains all of Blocks to render on the screen, and another vector that contains all of the FloatRects for collision detection.
I loop through each sprite in the block vector:
App.Draw(Blocks[i]);
And for collision, I loop through the FloatRects vector and check my collision logic against each part.
I don't plan on updating the ground or FloatRect vector after everything is generated, so I'm wondering if it's possible to make them into a collection so that I only need to draw one and check against one. Essentially create a large image to draw, and create an obscure shape with the FloatRect.
I'm not too sure about the FloatRect, because I assume the rectangle must be a rectangle.
I'm only interested in implementing this because occasionally my friends will fall through the ground, or the performance will get very slow occasionally. I haven't encountered falling through the ground, but I assume it's because it hasn't reached that point in iteration just yet.
I was also thinking about looping through Blocks that are only in the view, but I'm not sure how to exclude blocks that aren't in the view. I know how I can check to see if objects are viewable the player, but I'm not sure about removing them from the vector or excluding them from the loop.
Thanks for any help!