Prev: 26996 Up: Map Next: 27059
27023: Update Repellent Spray
Moves a repellent spray 4 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 27023 CALL StoreEntity Remember the position and state using StoreEntity.
27026 LD A,(IX+5) Jump to RemoveWeapon to remove the spray if it has hit a bug.
27029 AND A
27030 JR NZ,RemoveWeapon
27032 LD A,4 A=4 (the distance to move).
27034 BIT 6,(IX+0) Jump to UpdateRepellentSpray_Move if the spray is moving right (bit 6 is not set).
27038 JR Z,UpdateRepellentSpray_Move
27040 NEG Negate the distance (move left).
UpdateRepellentSpray_Move 27042 ADD A,(IX+1) Add the X position of the spray.
27045 CP 24 Jump to RemoveWeapon to remove the spray if it is past the left edge.
27047 JR C,RemoveWeapon
27049 CP 224 Jump to RemoveWeapon to remove the spray if it is past the right edge.
27051 JR NC,RemoveWeapon
27053 LD (IX+1),A Write the new X position.
27056 JP DrawObject Jump to DrawObject to draw the spray.
Prev: 26996 Up: Map Next: 27059