Re: A83: bg detail
[Prev][Next][Index][Thread]
Re: A83: bg detail
Shouldn't be too difficult just point to the level data, get the
first piece, compute which sprite to output, output it at the first
place, move penrow/col, move the pointer and repeat until done with
the screen. I could write a small piece of code if I have time.
You should put the getkey after this and if they move left or
right then move the pointer to the data forward or backwards how ever
many places you need to bring you to the next column of sprites and
then jump back up to the background loop.
It should be some what in this form. This should help but you will
have to put in most of the guts. There may be an easier way but this
is how I did it.
Jimmy
»»»Very quick example here don't qoute any of this
»»»I Skipped the primative steps
»»»There may be some things I forgot but you'll
»»»catch on after a while
loadbackground:
ld a, (datapointer)
cp 1
call z, loadsprite1
cp 2
call z, loadsprite2
cp 3
call z, loadsprite3
call drawsprite
;then change the penrow/col and check if your done
if not then jp loadbackground
if so then jp getkey
loadsprite1:
ld bc, sprite1
ret
loadsprite2:
ld bc, sprite2
ret
loadsprite3:
ld bc, sprite3
ret
drawsprite:
ld a, (penrow)
ld e, a
ld a, (pencol)
call movaxspriteroutine
ret
getkey:
check for key
if left or right then jp moveperson
jp getkey
moveperson:
move person if no collision
jp drawbackground
sprite1:
.db 1,1,1,1,1,1,1,1
ect...
sprite2:
.db 1,1,1,1,1,1,1,1
ect...
sprite3:
.db 1,1,1,1,1,1,1,1
ect...
data:
.db 1,2,3,1,1,1,1,1
.db 1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1
.db 1,1,1,1,1,1,1,1
ect...
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com