104 reputation
2
bio website
location
age
visits member for 3 months
seen Mar 19 at 15:56
stats profile views 0

C++/Java/C# coder. Qt and android developer


Feb
21
comment Is caching tiles like this a good idea?
Yeah, I don't need to do this every frame, but I have to get position of left-top corner of tile texture in a tileset image to draw it.
Feb
20
awarded  Supporter
Feb
20
comment Is caching tiles like this a good idea?
Well, every tile has it's own collision property. It's just an int. (0 - solid, 1 -walkable, for example). So instead of trying to find those values using tiles id, I can just compare id and if it was the same as now, that I don't need to search in vector
Feb
20
comment Is caching tiles like this a good idea?
Thanks, I'm just beginning to make my game and worry about everything because there will be a lot more stuff on the screen so I won't really know what causes perfomance issues
Feb
20
comment Is caching tiles like this a good idea?
Well, drawing is 60 frames per second and there are like 50-60 tiles on the screen on the moment, so I need to access elements of vector for 60 * 2 times(to get tx, ty) per frame
Feb
20
comment Is caching tiles like this a good idea?
I can't use lenght encoding, because I'm not really sure data will always stay the same way. I'm just wondering if storing last value will be faster than accessing vector
Feb
20
awarded  Student
Feb
20
asked Is caching tiles like this a good idea?