• entries
    437
  • comments
    1000
  • views
    335822

Indestructible

Sign in to follow this  

246 views

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...
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now