Re: A86: bomberman mapping


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

Re: A86: bomberman mapping



In a message dated 97-09-21 21:09:12 EDT, you write:

> >
>  > 1) Load the entire map into free memory and actually change the map
>  > when
>  > somehting is deleted.
>  > 2) Actaully check the pixel(s) on the screen to see if somthing is
>  > there
>  >
>  > 3) maintain a list in memory of all the changes to the original map
>  >
>  > i am SURE there are others. try and be creative
>  
>  the first 2 i had already thought of but don't know how. perhaps someone
>  can help me out... i would like to do the 1rst instead... i think i
>  could make the 2nd. but the first sounds better.
>  Russ Hanson
>  

The 1st really woudn't be that hard.  You could use just the buffer, rather
than the map whenever you reference it.

For example, if each map is 8x8 and you have 1 byte per square (not too
familiar with bomberman, but aren't there more than just 1 type of block?),
maybe something like this:
Level1:
 .db 1,1,1,1,1,1,1,1
 .db 1,0,0,1,0,1,0,1
 .db 1,0,1,2,0,1,0,1
 .db 1,0,1,1,0,1,0,1
 .db 1,0,0,0,0,0,0,1
 .db 1,0,0,1,1,0,0,1
 .db 1,0,0,1,1,0,0,1
 .db 1,1,1,1,1,1,1,1
LevelBuffer:
 .db 0,0,0,0,0,0,0,0
  ;(7 more times)

then you could use this code to load the level:

 ld hl,Level1              ;source
 ld de,LevelBuffer      ;destination
 ld bc,64                  ;# bytes
 ldir

and then use LevelBuffer when you reference the level.

~Steve