|
|
@ -6,13 +6,6 @@ Section "Player Data", WRAM0 |
|
|
|
playerWorldX: dw |
|
|
|
playerWorldY: dw |
|
|
|
|
|
|
|
; Sprite data |
|
|
|
playerSprite: |
|
|
|
playerScreenY: db |
|
|
|
playerScreenX: db |
|
|
|
playerTileIndex: db |
|
|
|
playerFlags: db |
|
|
|
|
|
|
|
Section "Player Code", ROM0 |
|
|
|
|
|
|
|
spriteData: |
|
|
@ -45,6 +38,13 @@ Player_Init:: |
|
|
|
ret |
|
|
|
|
|
|
|
Player_Update:: |
|
|
|
; Only update every 2 frames |
|
|
|
ld hl, frame |
|
|
|
ld a, [hl] |
|
|
|
and %1 |
|
|
|
cp %1 |
|
|
|
jr nz, .done |
|
|
|
|
|
|
|
ld hl, keys |
|
|
|
ld b, [hl] |
|
|
|
|
|
|
@ -59,8 +59,10 @@ Player_Update:: |
|
|
|
cp 160 |
|
|
|
jr nc, .done |
|
|
|
|
|
|
|
ld hl, _OAM + 1 |
|
|
|
; Update x-position and set x-flip = false |
|
|
|
inc [hl] |
|
|
|
ld hl, _OAM + 3 |
|
|
|
res 5, [hl] |
|
|
|
|
|
|
|
.left: |
|
|
|
; check for left button |
|
|
@ -74,7 +76,10 @@ Player_Update:: |
|
|
|
cp 9 |
|
|
|
jr c, .done |
|
|
|
|
|
|
|
; Update x-position and set x-flip = true |
|
|
|
dec [hl] |
|
|
|
ld hl, _OAM + 3 |
|
|
|
set 5, [hl] |
|
|
|
|
|
|
|
.done: |
|
|
|
ret |