Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/overworld/doors.asm
1271 views
1
; returns whether the player is standing on a door tile in carry
2
IsPlayerStandingOnDoorTile:
3
push de
4
ld hl, DoorTileIDPointers
5
ld a, [wCurMapTileset]
6
ld de, $3
7
call IsInArray
8
pop de
9
jr nc, .notStandingOnDoor
10
inc hl
11
ld a, [hli]
12
ld h, [hl]
13
ld l, a
14
lda_coord 8, 9 ; a = lower left background tile under player's sprite
15
ld b, a
16
.loop
17
ld a, [hli]
18
and a
19
jr z, .notStandingOnDoor
20
cp b
21
jr nz, .loop
22
scf
23
ret
24
.notStandingOnDoor
25
and a
26
ret
27
28
INCLUDE "data/tilesets/door_tile_ids.asm"
29
30