Storing the collision map is interesting. At the moment I'm not doing it properly, I'm still using the original tile info. My plan is to store some info about the collision info in a separate tilemap. The original plan was to use an array of bools, I may still use this - but I'm pondering whether I could pack the data into ints instead. So an int holds 32 bits, which coincidentally is the width and height of my tile. If I have a couple of ints, I can pack in the collision info for the whole tile and do some quick block or row tests. If the value is 0, I can immediately know that the block is empty and move on instead of trying to test each pixel in between. It does feel like premature optimisation though...
I've been messing about some more with indestructible tiles and have been wondering whether such things are better done using objects, either by a game entity or as an object tile layer. With an explicit object it'd give me more freedom to move it around and do things with it; it'd also be simpler to animate as it becomes divorced from the tilemap itself.
Storing the collision map is interesting. At the moment I'm not doing it properly, I'm still using the original tile info. My plan is to store some info about the collision info in a separate tilemap. The original plan was to use an array of bools, I may still use this - but I'm pondering whether I could pack the data into ints instead. So an int holds 32 bits, which coincidentally is the width and height of my tile. If I have a couple of ints, I can pack in the collision info for the whole tile and do some quick block or row tests. If the value is 0, I can immediately know that the block is empty and move on instead of trying to test each pixel in between. It does feel like premature optimisation though...
Storing the collision map is interesting. At the moment I'm not doing it properly, I'm still using the original tile info. My plan is to store some info about the collision info in a separate tilemap. The original plan was to use an array of bools, I may still use this - but I'm pondering whether I could pack the data into ints instead. So an int holds 32 bits, which coincidentally is the width and height of my tile. If I have a couple of ints, I can pack in the collision info for the whole tile and do some quick block or row tests. If the value is 0, I can immediately know that the block is empty and move on instead of trying to test each pixel in between. It does feel like premature optimisation though...
Previous Entry
Destruction / Indestruction
Next Entry
GameMonkey and Data Extensions
Advertisement
Latest Entries
Old Code
4295 views
Chamois - Fluent Assertion Syntax for C++
5752 views
On C++ Naming Conventions
12800 views
First version of FlatBuffers in .NET
3857 views
FlatBuffers in .NET
10994 views
Porting Accidental Noise Library to .NET
5565 views
Cloudy Requests
1929 views
Advertisement