Access to tilemap data from an image resource

SGDK only sub forum

Moderator: Stef

Post Reply
BroOfTheSun
Interested
Posts: 33
Joined: Fri Dec 12, 2014 2:41 am
Location: USA - Chicago, IL

Access to tilemap data from an image resource

Post by BroOfTheSun » Tue May 12, 2015 12:36 am

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
Last edited by BroOfTheSun on Tue May 12, 2015 12:22 pm, edited 1 time in total.

Moon-Watcher
Very interested
Posts: 117
Joined: Sun Jan 02, 2011 9:14 pm
Contact:

Re: Access to tilemap data from an image resource

Post by Moon-Watcher » Tue May 12, 2015 1:04 am

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.

Post Reply