[A83] Re: Tilemap


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

[A83] Re: Tilemap



Well... 
You should check out TCPA's tilemap routine... but read this..
-------------------------
This is how I was taught.......
You should start out with a simple 8x12 tilemap.
First, you need a routine that draws the map. The map should be under the 
proper label, such as

tilemap:

Next, we need the map

.db 1,1,1,1,1,1,1,1,1,1,1,1
.db 1,0,0,2,3,0,0,0,0,0,0,1
.db 1,0,0,4,5,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,0,1
.db 1,0,0,0,0,0,0,0,0,0,0,1
.db 1,1,1,1,1,1,1,1,1,1,1,1

See how that is 12 numbers wide, and 8 numbers high? Now we need the tile 
set. These tiles should be under the label 'tiles'.

tiles:

floor:           ;0
.db  %00000000
.db  %00000000
.db  %00000000
.db  %00000000
.db  %00000000
.db  %00000000
.db  %00000000
.db  %00000000

wall:          ;1
.db  %11111111
.db  %11111111
.db  %11111111
.db  %11111111
.db  %11111111
.db  %11111111
.db  %11111111
.db  %11111111

tabletopl:       ;2
.db  %11111111
.db  %10000000
.db  %10000000
.db  %10000000
.db  %10000000
.db  %10000000
.db  %10000000
.db  %10000000

tabletopr:      ;3
.db  %11111111
.db  %00000001
.db  %00000001
.db  %00000001
.db  %00000001
.db  %00000001
.db  %00000001
.db  %00000001

tablebotl:        ;4
.db  %10000000
.db  %10000000
.db  %10000000
.db  %10000000
.db  %11111111
.db  %00110000
.db  %00110000
.db  %00110000
.db  %00110000

tablebotr:      ;5
.db  %00000001
.db  %00000001
.db  %00000001
.db  %00000001
.db  %11111111
.db  %00001100
.db  %00001100
.db  %00001100
.db  %00001100

Okay... those tiles are actually 8x8 sprites, which when set up 8 up and 
down, and 12 left and right, fills the entire screen. The first tile under 
the tiles label is called 'floor'. This tile is totally blank, and the 
character sprite can walk on this. It is tile value 0, and on the map, 
wherever there is a 0, this floor tile will show up. Any tile after the 0 is 
not 'walkable' unless specifically modified. Wherever there is a 1 on the 
map, the tile with the value 1 will show up. Wherever there is a 2 on the 
map, the tile with the value 2 will show up. 

I really hope this helps. Feel free to ask again if you need more help, or 
want me to write a demo.

darkfire139@aol.com





Follow-Ups: