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
Access to tilemap data from an image resource
Moderator: Stef
-
- Interested
- Posts: 33
- Joined: Fri Dec 12, 2014 2:41 am
- Location: USA - Chicago, IL
Access to tilemap data from an image resource
Last edited by BroOfTheSun on Tue May 12, 2015 12:22 pm, edited 1 time in total.
-
- Very interested
- Posts: 117
- Joined: Sun Jan 02, 2011 9:14 pm
- Contact:
Re: Access to tilemap data from an image resource
One way or another you have to define which of those tiles are blocks. The tilemap doesn't store that info.BroOfTheSun wrote:I can write a struct that has the locations for collision blocks, but isn't that duplicating data?