Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/overworld/is_player_just_outside_map.asm
1271 views
1
; returns whether the player is one tile outside the map in Z
2
IsPlayerJustOutsideMap:
3
ld a, [wYCoord]
4
ld b, a
5
ld a, [wCurMapHeight]
6
call .compareCoordWithMapDimension
7
ret z
8
ld a, [wXCoord]
9
ld b, a
10
ld a, [wCurMapWidth]
11
.compareCoordWithMapDimension
12
add a
13
cp b
14
ret z
15
inc b
16
ret
17
18