summaryrefslogtreecommitdiff
path: root/engine/overworld/movement.asm
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2014-09-08 23:32:33 -0700
committerYamaArashi <shadow962@live.com>2014-09-08 23:32:33 -0700
commitdaf4fc87ae66e2c3d56840774efba10a9b903ee3 (patch)
treedfcafe62237afac0f3de7fef3b024de40e37a991 /engine/overworld/movement.asm
parent59f0507e4cd0693eb89f5ab3e44cb3c442666140 (diff)
Add comments regarding menus and sprites
Diffstat (limited to 'engine/overworld/movement.asm')
-rw-r--r--engine/overworld/movement.asm17
1 files changed, 10 insertions, 7 deletions
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index dbec2e4f..d84079ad 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -1,22 +1,25 @@
UpdatePlayerSprite: ; 4e31 (1:4e31)
ld a, [wSpriteStateData2]
and a
- jr z, .asm_4e41
+ jr z, .checkIfTextBoxInFrontOfSprite
cp $ff
- jr z, .asm_4e4a
+ jr z, .disableSprite
dec a
ld [wSpriteStateData2], a
- jr .asm_4e4a
-.asm_4e41
+ jr .disableSprite
+; check if a text box is in front of the sprite by checking if the lower left
+; background tile the sprite is standing on is greater than $5F, which is
+; the maximum number for map tiles
+.checkIfTextBoxInFrontOfSprite
aCoord 8, 9
ld [$ff93], a
cp $60
- jr c, .asm_4e50
-.asm_4e4a
+ jr c, .lowerLeftTileIsMapTile
+.disableSprite
ld a, $ff
ld [wSpriteStateData1 + 2], a
ret
-.asm_4e50
+.lowerLeftTileIsMapTile
call DetectCollisionBetweenSprites
ld h, $c1
ld a, [wWalkCounter] ; wcfc5