Re: A86: Question on tile maps


[Prev][Next][Index][Thread]

Re: A86: Question on tile maps




I'm not much for explaining, and my system of tilemaps is probably not that
great. But, something that I have used with tilemaps seems to be quite
effective and I wanted to share it...

Store all of your sprites for the map in one big area of memory, with only
a label at the starting, like this:

Map_Tiles:
 .db %00000000 ; blank ( #0 )
 .db %00000000
 .db %00000000
 .db %00000000
 .db %00000000
 .db %00000000
 .db %00000000
 .db %00000000

 .db %11111111 ; bricks ( #1 )
 .db %00100000
 .db %00100000
 .db %11111111
 .db %00000010
 .db %00000010
 .db %11111111
 .db %11111111

 ...etc

As you can see there is only the one label (and comments to assist you).
Then when you read the map array, whatever the # in a specific array
element is, is the # of the sprite you want to use. So you just multiply
that number by 8 (8 bytes/sprite) and add that to Map_Tiles to point the
the correct sprite.

I found this method bypasses the use of many cp's. It might also work well
to use a table, which I never bothered to try.

I hope this helps you in some way. I'm sorry I can't help you with the
reading/drawing of the map.

Dave



At 08:19 PM 1/26/99 -0800, you wrote:
>
>unfortunately, i don't know too much about tile maps.  i do know that in
>order to make a map, you make like how i made it down below (i think).  in
>order to put it to the screen, there is a routine on 86 central-
>http://ti86.acz.org.
>akshay
>----- Original Message -----
>From: <BlAsTo1414@aol.com>
>To: <assembly-86@lists.ticalc.org>
>Sent: Tuesday, January 26, 1999 7:28 PM
>Subject: Re: A86: Question on tile maps
>
>
>>
>>what kind of a program are you writing?  I see that you are using a map, so
>I
>>am assuming you are writing a game.  since no one else would help me, I'll
>ask
>>you.  How would I make a map(for a game like Chips Challenge{tiles also})
>>print it to the screen and move a sprite over top of it?  I also need to
>know
>>how to check for collisions with other spites.  ANY help on ANY of these
>>questions would be appreciated SO much.  :-)
>>
>>Thank you,
>>BlAsTo1414
>>
>>
>>> i have a question for tile maps.  suppose i have the following map:
>>>  Map1:
>>>  .db $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1
>>>  .db $1,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$1
>>>  .db $1,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$1
>>>  .db $1,$0,$0,$0,$0,$0,$2,$2,$2,$0,$0,$0,$0,$0,$0,$1
>>>  .db $1,$0,$0,$0,$0,$0,$2,$2,$2,$0,$0,$0,$0,$0,$0,$1
>>>  .db $1,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$1
>>>  .db $1,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$0,$1
>>>  .db $1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1,$1
>>>
>>>  if i do  the following:
>>>  ld hl,Map1
>>>  inc hl
>>>
>>>  would hl contain the first element of the map? or when i load hl with
>the
>>> map, does it already point to the first element?  Also, <add hl,de> would
>>> move to the next row right? (de has 16 in it).
>>>
>>>  thanks
>>>  akshay
>>>
>>
>>
>
>
>
>



References: