1
Graphics / Help! Regarding view and world drawing
« on: March 08, 2016, 10:52:00 am »
Hi,
I'm not experienced at all, but i did write a couple of games. I just started with a new one now, but since i want to do this right from the get-go i wanted to double check if the way i go about drawing the world map is in fact the right way to go (or rather - my best option)
Assuming an RPG like game with a tilebased map (standard stuff i suppose).
1. i'd load my map into a 2-dimensional vector (for x, y coords)
2. Each map location has a vector of tiles (so i can layer tiles: i.e: water -> bridge -> signpost
3. At least 25 frames per second i call the draw function
4. The draw function loops through the map vector and compares x,y coordinates with view x,y coords
5. Everything that's within the view is redrawn, keeping tile order in mind per map position
Does this make sense? Or is this highly ineffective compared to an alternative (like drawing the entire tile map only once and then update those tiles requiring change).
kind regards,
Bitano
I'm not experienced at all, but i did write a couple of games. I just started with a new one now, but since i want to do this right from the get-go i wanted to double check if the way i go about drawing the world map is in fact the right way to go (or rather - my best option)
Assuming an RPG like game with a tilebased map (standard stuff i suppose).
1. i'd load my map into a 2-dimensional vector (for x, y coords)
2. Each map location has a vector of tiles (so i can layer tiles: i.e: water -> bridge -> signpost
3. At least 25 frames per second i call the draw function
4. The draw function loops through the map vector and compares x,y coordinates with view x,y coords
5. Everything that's within the view is redrawn, keeping tile order in mind per map position
Does this make sense? Or is this highly ineffective compared to an alternative (like drawing the entire tile map only once and then update those tiles requiring change).
kind regards,
Bitano