Prev: 43236 Up: Map Next: 43372
43314: Materialise Entity
The handler for entity types 64 to 74, 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 43314 LD A,(IX+5) Fetch the type that the entity will have when it has finished materialising.
43317 SUB 16 Jump if that is a type for the robot (16 to 47).
43319 CP 32
43321 JR C,MaterialiseEntity_Robot
43323 CALL AddEntity Draw the entity using AddEntity.
43326 JR NC,MaterialiseEntity_Next Jump if it is not on the screen.
43328 CALL MakeRandomBeep Make the sound of materialising using MakeRandomBeep.
MaterialiseEntity_Next 43331 INC (IX+0) Move on to the next sprite.
43334 RET Return.
MaterialiseEntity_Robot 43335 PUSH IX Save the address of the entity...
43337 POP HL ...and copy it into HL.
43338 PUSH HL Save it again.
43339 LD IX,43372 Use a temporary entity at TemporaryEntity...
43343 LD DE,43372 ...as the destination...
43346 LD BC,8 ...and copy the first eight bytes...
43349 LDIR ...of the entity into it.
43351 LD L,(IX+1) Fetch the X position of the entity...
43354 LD H,(IX+2) ...and the Y position.
43357 LD DE,64 Use an offset of 64 in the X direction.
43360 CALL DrawShiftedEntity Draw the entity at the offset using DrawShiftedEntity.
43363 JR NC,MaterialiseEntity_OffScreen Jump if it is not on the screen.
43365 CALL MakeRandomBeep Make the sound of materialising using MakeRandomBeep.
MaterialiseEntity_OffScreen 43368 POP IX Restore the entity.
43370 JR MaterialiseEntity_Next Jump to move on to the next sprite.
Prev: 43236 Up: Map Next: 43372