Hi Guys,
First of all sorry for my bad English.
I need little help with my Tile map drawing, i have tried to google and search about this but i could not find what i was looking for.
i am just using simple code to draw tile map on the screen and it works greate. But when i try to draw bigger map it gets SLOW! from 60 FPS to 30 FPS.
It gets slow because it draws all the tiles that are not visable on the screen
So how can i fix this? how can i make it only draw tiles that are visiable on screen so when scrolling it will scroll in my Map Array
int i;
for ( int x = 0; x < map_size; x++ )
{
for ( int y = 0; y < map_size; y++ )
{
dbSprite ( i, x * Tilewidth + CameraPositionX, y * Tileheight + CameraPositionY, i);
i++;
}
}
I hope someone can help me with this.
Thank you all in advance.