|
|
@ -10,7 +10,7 @@ playerWorldY: dw |
|
|
|
|
|
|
|
; player data |
|
|
|
PLAYER_X:: db |
|
|
|
PLAYER_Y:: db |
|
|
|
PLAYER_Y:: dw |
|
|
|
PLAYER_DIR:: db |
|
|
|
|
|
|
|
PLAYER_JUMPING:: db |
|
|
@ -44,6 +44,8 @@ Player_Init:: |
|
|
|
ld [hl], 0 |
|
|
|
inc hl |
|
|
|
ld [hl], 0 |
|
|
|
inc hl |
|
|
|
ld [hl], 0 |
|
|
|
|
|
|
|
; Copy sprite to VRAM |
|
|
|
ld bc, _VRAM8000 + SPRITE_IDX * 16 |
|
|
@ -104,9 +106,12 @@ Player_Update:: |
|
|
|
STORE16 bc |
|
|
|
|
|
|
|
; y -= floor(vy) |
|
|
|
ld hl, PLAYER_Y |
|
|
|
ld hl, PLAYER_Y + 1 |
|
|
|
ld a, [hl] |
|
|
|
sub c |
|
|
|
ld [hl-], a |
|
|
|
ld a, [hl] |
|
|
|
sub b |
|
|
|
sbc b |
|
|
|
ld [hl], a |
|
|
|
|
|
|
|
; roll back jump if there was a collision |
|
|
@ -216,6 +221,7 @@ update_oam: |
|
|
|
and OAMF_XFLIP |
|
|
|
ld c, a |
|
|
|
|
|
|
|
dec hl ; skip fractional part |
|
|
|
ld a, [hl-] ; y |
|
|
|
add 16 |
|
|
|
|
|
|
|