I'm using sfml 2.0-rc, Windows 7, and Visual studio 2010.
Here is my snippet of code:
for(int nrow = 0; nrow < 24; nrow++)
{
for (int ncol = 0; ncol < 33; ncol++)
{
sprite2.setPosition(ncol * 32, nrow * 32);
sprite1.setPosition(ncol * 32, nrow * 32);
if (dDungeon[nrow][ncol] == '#')
{
CollisionRectangles[nrow][ncol] = sf::FloatRect (ncol*32, nrow*32,32,32);
window.draw(sprite1);
}
if (dDungeon[nrow][ncol] == ' ')
{
window.draw(sprite2);
}
}
}
I'm getting some kind of error when I hover over the sf::FloatRect, which reads:
"Error: No suitable Conversion function from "sf::FloatRect" to "float" exists.
I don't really understand this at all, can anyone help?
With this code, I'm creating a tilemap from sprites, and putting one collision rectangle over every single sprite so that I can define collision detection later with a moving character sprite.
So how do I load 792 different (24*33) collision rectangles into an array made to store them?