[A83] Re: Tilemap
[Prev][Next][Index][Thread]
[A83] Re: Tilemap
At 15:46 2001-10-14, you wrote:
> > and tile collision? Like if sprite touches tile 2, then something happens?
>That requires a totally different approach...
>You might want to try something like this:
>collissionmap: ;0 is walkable, 1 is collission
> .db 0,0,0,0,0,0,0,0,0,0,0,0
A smart thing to do here to avoid having a separate collision map is to put
the non walkable tiles in the low numbers, like 0-63 and the walkable
sprites in the high values.
Then you save a lot of memory for the maps.
It does though put the limitation that the same sprite always is walkable
or not, wich sometimes might not be wanted. (I don't know, secret passages,
whatever) But I think it would be smarter then to do this approach anyway,
and have a dublicate sprite instead, that is, two sprites that look the
same, one in the walkable area and one in the nonwalkable.
Still saves a lot of memory.
specially since you anyways probably want to do the map indirect, so you
can save the pointer to the same sprite two times in the table over what
tilemap value corresponds to what sprite.
Then there is no extra memory needed for sprites that look the same and is
both walkable and nonwalkable.
///Olle
References: