Page 1 of 1

Access to tilemap data from an image resource

Posted: Tue May 12, 2015 12:36 am
by BroOfTheSun
I'm using an image to display a background for a level, and I use rescomp to compile the image. I want to be able to track certain blocks in the image to use for collision detection. The image struct already has the tilemap data. So my question is, can I reuse that data to track where collision blocks are?

I can write an array that has the locations for collision blocks, but isn't that duplicating data?

*updated to change storing data in struct to storing data in array

Re: Access to tilemap data from an image resource

Posted: Tue May 12, 2015 1:04 am
by Moon-Watcher
BroOfTheSun wrote:I can write a struct that has the locations for collision blocks, but isn't that duplicating data?
One way or another you have to define which of those tiles are blocks. The tilemap doesn't store that info.