aboutsummaryrefslogtreecommitdiff
path: root/enemiesattacks
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-04-29 15:51:10 +0200
committerAstatin <[email protected]>2025-04-29 15:51:10 +0200
commitc7d3a2929e9ed719b342e92a54d292d57ee105d2 (patch)
tree6e845d6163b59fbc2978f4cbadefb4fb5357126a /enemiesattacks
parent7faf16e4453f935ee1159d32ddc2a6501ea91bbb (diff)
Add Load_Dungeon function
Diffstat (limited to 'enemiesattacks')
-rw-r--r--enemiesattacks/laser.gbasm32
1 files changed, 16 insertions, 16 deletions
diff --git a/enemiesattacks/laser.gbasm b/enemiesattacks/laser.gbasm
index c26e4e3..9e2f67d 100644
--- a/enemiesattacks/laser.gbasm
+++ b/enemiesattacks/laser.gbasm
@@ -1,20 +1,4 @@
Laser_sight_check: ; BC = XY of the enemy. D is unchanged. Direction to face in E (or 0 if not)
- LD A, E
- DEC A
- DEC D
- XOR D
- INC D
- CP $00
- JR Z, =.attack
- BIT 1, A
- JR NZ, =.attack
-
- LD A, E
- OR $00
- LD D, A
- RET
-
- .attack:
LD E, $00
; straight line + distance <= 4
@@ -65,6 +49,22 @@ Laser_sight_check: ; BC = XY of the enemy. D is unchanged. Direction to face in
RET
Laser_Enemy_Attack: ; Direction to face in E. Result in BC (XY), Direction in D
+ LD A, E
+ DEC A
+ DEC D
+ XOR D
+ INC D
+ CP $00
+ JR Z, =.attack
+ BIT 1, A
+ JR NZ, =.attack
+
+ LD A, E
+ OR $00
+ LD D, A
+ RET
+
+ .attack:
PUSH DE
PUSH BC