-
Notifications
You must be signed in to change notification settings - Fork 0
/
enemy_boss_eyes.asm
51 lines (49 loc) · 958 Bytes
/
enemy_boss_eyes.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
; temp00 = eye sprite x origin
; temp01 = eye sprite y origin
enemy_boss_eyes: subroutine
; EYE SPRITE
.now_lets_add_eyes
ldx #$fc
lda #$a9
sta oam_ram_spr,x
lda boss_eyes_pal
sta oam_ram_att,x
; find x
lda temp00
sta oam_ram_x,x
; check if rudy is left of vampire
cmp player_x_hi
bcc .looking_right
.looking_left
lda #$99
sta oam_ram_spr,x
;inc oam_ram_x,x
.looking_right
; find y
ldy temp01
iny
tya
ldy enemy_oam_offset
sta oam_ram_y,x
clc
adc #$1c
sec
sbc player_y_hi
bcc .looking_down
clc
adc #$cc
bcs .looking_up
.looking_across
lda oam_ram_spr,x
cmp #$99
beq .adjust_for_left_looking
jmp .done
.adjust_for_left_looking
rts
.looking_up
dec oam_ram_y,x
rts
.looking_down
inc oam_ram_y,x
.done
rts