diff options
Diffstat (limited to 'engine/overworld/movement.asm')
-rw-r--r-- | engine/overworld/movement.asm | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 6fb388fd..f2334479 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -1,3 +1,5 @@ +MAP_TILESET_SIZE EQU $60 + UpdatePlayerSprite: ld a, [wSpriteStateData2] and a @@ -13,7 +15,7 @@ UpdatePlayerSprite: .checkIfTextBoxInFrontOfSprite aCoord 8, 9 ld [hTilePlayerStandingOn], a - cp $60 + cp MAP_TILESET_SIZE jr c, .lowerLeftTileIsMapTile .disableSprite ld a, $ff @@ -112,7 +114,7 @@ UpdateNPCSprite: and a jp z, InitializeSpriteStatus call CheckSpriteAvailability - ret c ; if sprite is invisible, on tile >=$60, in grass or player is currently walking + ret c ; if sprite is invisible, on tile >=MAP_TILESET_SIZE, in grass or player is currently walking ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] ld l, a @@ -290,9 +292,9 @@ UpdateSpriteInWalkingAnimation: ld a, [H_CURRENTSPRITEOFFSET] ld l, a inc h - ld a, [hl] ; c2x0 (walk animantion counter) + ld a, [hl] ; c2x0 (walk animation counter) dec a - ld [hl], a ; update walk animantion counter + ld [hl], a ; update walk animation counter ret nz ld a, $6 ; walking finished, update state add l @@ -406,7 +408,7 @@ InitializeSpriteStatus: call InitializeSpriteScreenPosition ; could have done fallthrough here ret -; calculates the spprite's scrren position form its map position and the player position +; calculates the sprite's screen position form its map position and the player position InitializeSpriteScreenPosition: ld h, wSpriteStateData2 / $100 ld a, [H_CURRENTSPRITEOFFSET] @@ -480,21 +482,21 @@ CheckSpriteAvailability: ; make the sprite invisible if a text box is in front of it ; $5F is the maximum number for map tiles call GetTileSpriteStandsOn - ld d, $60 + ld d, MAP_TILESET_SIZE ld a, [hli] cp d - jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom left tile) + jr nc, .spriteInvisible ; standing on tile with ID >=MAP_TILESET_SIZE (bottom left tile) ld a, [hld] cp d - jr nc, .spriteInvisible ; standing on tile with ID >=$60 (bottom right tile) + jr nc, .spriteInvisible ; standing on tile with ID >=MAP_TILESET_SIZE (bottom right tile) ld bc, -20 add hl, bc ; go back one row of tiles ld a, [hli] cp d - jr nc, .spriteInvisible ; standing on tile with ID >=$60 (top left tile) + jr nc, .spriteInvisible ; standing on tile with ID >=MAP_TILESET_SIZE (top left tile) ld a, [hl] cp d - jr c, .spriteVisible ; standing on tile with ID >=$60 (top right tile) + jr c, .spriteVisible ; standing on tile with ID >=MAP_TILESET_SIZE (top right tile) .spriteInvisible ld h, wSpriteStateData1 / $100 ld a, [H_CURRENTSPRITEOFFSET] @@ -655,7 +657,7 @@ CanWalkOntoTile: scf ; set carry (marking failure to walk) ret -; calculates the tile pointer pointing to the tile the current sprite stancs on +; calculates the tile pointer pointing to the tile the current sprite stands on ; this is always the lower left tile of the 2x2 tile blocks all sprites are snapped to ; hl: output pointer GetTileSpriteStandsOn: |