Prev: 40471 Up: Map Next: 40557
40518: Update Shot Entity
Updates an entity of the type 14 which is made by UpdateSaucerEntity. The entity falls until its third coordinate reaches 259.
Input
IX The entity
UpdateShotEntity 40518 LD A,(IX+22) Read field 22 of the entity.
40521 AND %11110000 Keep the counter.
40523 JR Z,UpdateShotEntity_Fall Jump to UpdateShotEntity_Fall if it is zero.
40525 CALL DecreaseEntityCounter Call DecreaseEntityCounter to count down.
40528 JP UpdateEntity_Project Jump to UpdateEntity_Project to carry on updating the entity.
UpdateShotEntity_Fall 40531 LD A,(IX+8) Fetch the first byte of the third coordinate of the entity.
40534 DEC A Subtract one.
40535 JR NZ,UpdatePuffEntity_Test Jump to UpdatePuffEntity_Test unless it was 1.
40537 LD A,(IX+9) Fetch the second byte of the third coordinate of the entity.
40540 CP 3 Jump to UpdatePuffEntity_Test if it is 3 or more.
40542 JR NC,UpdatePuffEntity_Test
40544 LD (IX+9),3 Set the second byte of the third coordinate to 3.
40548 XOR A Set A to zero.
40549 LD (IX+18),A Set field 18 of the entity to zero.
40552 LD (IX+19),A Set field 19 of the entity to zero.
40555 JR UpdatePuffEntity_Test Jump to UpdatePuffEntity_Test.
Prev: 40471 Up: Map Next: 40557