|
|
@ -32,7 +32,8 @@ DEF TILE_SIZE EQU 16 ; Total length of tile in bytes |
|
|
|
|
|
|
|
DEF GRAVITY EQU (0 << 8) | $2e ; 0.18 |
|
|
|
DEF INIT_VY EQU (3 << 8) | $99 ; 3.60 |
|
|
|
DEF INIT_FALL_VY EQU ($ff << 8) | $1a ; a.b |
|
|
|
DEF INIT_FALL_VY EQU ($ff << 8) | $1a ; -1.1015625 |
|
|
|
DEF MAX_VY EQU ($f9 << 8) | $00 ; -7.0 |
|
|
|
|
|
|
|
Player_Init:: |
|
|
|
; Clear player data (X/Y initialized by map engine) |
|
|
@ -91,6 +92,19 @@ Player_Update:: |
|
|
|
sbc HIGH(GRAVITY) |
|
|
|
ld b, a |
|
|
|
|
|
|
|
; we only need to clamp when moving down |
|
|
|
bit 7, b |
|
|
|
jr z, .no_clamp |
|
|
|
|
|
|
|
; vy = MIN(MAX_VY, vy) |
|
|
|
ld a, b |
|
|
|
cp HIGH(MAX_VY) |
|
|
|
jr c, .no_clamp |
|
|
|
|
|
|
|
ld b, HIGH(MAX_VY) |
|
|
|
ld c, LOW(MAX_VY) |
|
|
|
|
|
|
|
.no_clamp: |
|
|
|
ld hl, PLAYER_VY |
|
|
|
STORE16 bc |
|
|
|
|
|
|
|