pokered/engine/overworld/is_player_just_outside_map.asm

17 lines
288 B
NASM
Raw Normal View History

; returns whether the player is one tile outside the map in Z
2016-06-12 00:24:04 +00:00
IsPlayerJustOutsideMap:
2015-08-31 02:38:41 +00:00
ld a, [wYCoord]
ld b, a
2015-08-31 02:38:41 +00:00
ld a, [wCurMapHeight]
call .compareCoordWithMapDimension
ret z
2015-08-31 02:38:41 +00:00
ld a, [wXCoord]
ld b, a
2015-08-31 02:38:41 +00:00
ld a, [wCurMapWidth]
.compareCoordWithMapDimension
add a
cp b
ret z
inc b
ret