Prev: A8E4 Up: Map Next: A96C
A932: Materialise Entity
The handler for entity types 40 to 4A, which are the sprites that show an enemy, or the robot, materialising. When the entity is going to be the robot it is drawn twice, once at a slight offset, which makes the picture look like it is shimmering. Each sprite is shown for a frame, and the next one is chosen by changing the type.
Input
IX Entity
MaterialiseEntity A932 LD A,(IX+$05) Fetch the type that the entity will have when it has finished materialising.
A935 SUB $10 Jump if that is a type for the robot (10 to 2F).
A937 CP $20
A939 JR C,MaterialiseEntity_Robot
A93B CALL AddEntity Draw the entity using AddEntity.
A93E JR NC,MaterialiseEntity_Next Jump if it is not on the screen.
A940 CALL MakeRandomBeep Make the sound of materialising using MakeRandomBeep.
MaterialiseEntity_Next A943 INC (IX+$00) Move on to the next sprite.
A946 RET Return.
MaterialiseEntity_Robot A947 PUSH IX Save the address of the entity...
A949 POP HL ...and copy it into HL.
A94A PUSH HL Save it again.
A94B LD IX,$A96C Use a temporary entity at TemporaryEntity...
A94F LD DE,$A96C ...as the destination...
A952 LD BC,$0008 ...and copy the first eight bytes...
A955 LDIR ...of the entity into it.
A957 LD L,(IX+$01) Fetch the X position of the entity...
A95A LD H,(IX+$02) ...and the Y position.
A95D LD DE,$0040 Use an offset of 40 in the X direction.
A960 CALL DrawShiftedEntity Draw the entity at the offset using DrawShiftedEntity.
A963 JR NC,MaterialiseEntity_OffScreen Jump if it is not on the screen.
A965 CALL MakeRandomBeep Make the sound of materialising using MakeRandomBeep.
MaterialiseEntity_OffScreen A968 POP IX Restore the entity.
A96A JR MaterialiseEntity_Next Jump to move on to the next sprite.
Prev: A8E4 Up: Map Next: A96C