Can somebody tell me how one would approach making a tile engine.
I used to use sdl so im used to being to just blit a surface.
Is this possible in sfml if so how do you do it?
example code from sdl
for (int r = 0; r < rows; r++)
{
for (int c = 0; c < columns; c++)
{
SDL_Rect rect = {c * tileWidth, r * tileHeight, tileWidth, tileHeight}
switch(map[r][c])
{
case 0:
break;
case 1:
SDL_BlitSurface(tileImage, NULL, screen, &rect);
break;
}
}
}
So pretty much is it possible to recreate something similar in sfml. Or if not what should I do?[/code]