Prev: 6974 Up: Map Next: 69B3
698F: Update Repellent Spray
Moves a repellent spray 04 pixels at a time in the direction it was fired. The spray is removed if it hits a bug (see CheckWeaponHit) or reaches the edge of the play area.
Input
IX Repellent spray object
UpdateRepellentSpray 698F CALL StoreEntity Remember the position and state using StoreEntity.
6992 LD A,(IX+$05) Jump to RemoveWeapon to remove the spray if it has hit a bug.
6995 AND A
6996 JR NZ,RemoveWeapon
6998 LD A,$04 A=04 (the distance to move).
699A BIT 6,(IX+$00) Jump to UpdateRepellentSpray_Move if the spray is moving right (bit 6 is not set).
699E JR Z,UpdateRepellentSpray_Move
69A0 NEG Negate the distance (move left).
UpdateRepellentSpray_Move 69A2 ADD A,(IX+$01) Add the X position of the spray.
69A5 CP $18 Jump to RemoveWeapon to remove the spray if it is past the left edge.
69A7 JR C,RemoveWeapon
69A9 CP $E0 Jump to RemoveWeapon to remove the spray if it is past the right edge.
69AB JR NC,RemoveWeapon
69AD LD (IX+$01),A Write the new X position.
69B0 JP DrawObject Jump to DrawObject to draw the spray.
Prev: 6974 Up: Map Next: 69B3