Prev: 26088 Up: Map Next: 26161
26119: Handle Monster
The handler for the monster (IDs 36 and 37), which pops up out of one of the dustbins at the bottom of the screen (it is created by CreateMonster). Byte 6 of the actor is its state, which chooses which code at HandleMonster_Rising is run using the table at MonsterStates. If a flour shot hits the monster it is coloured white (see TestFlourCollision), the points are added to the score, and it goes straight to the state in which it drops back into the dustbin.
Input
IX Actor
HandleMonster 26119 LD HL,24347 Point HL at the number of actors in play (ActorsInPlay).
26122 INC (HL) Increase it by one.
26123 CALL StoreEntity Record the position of the sprite using StoreEntity.
26126 LD A,(IX+3) Fetch the colour of the monster.
26129 CP 71 Jump to HandleMonster_State if it has been hit already.
26131 JR Z,HandleMonster_State
26133 CALL TestFlourCollision Test whether a flour shot has hit the actor using TestFlourCollision.
26136 BIT 7,(IX+0) Jump to HandleMonster_State if the monster has not been hit by the flour shot (is bit 7 of the actor ID set).
26140 JR Z,HandleMonster_State
26142 LD (IX+6),2 Write 2 to the state of the monster, so that it drops back into the dustbin.
26146 LD BC,293 Set the points for hitting the monster (293 in BCD).
26149 CALL AddPointsToScore Add the points to the score using AddPointsToScore.
HandleMonster_State 26152 LD HL,26161 Point HL at the table of monster states.
26155 LD A,(IX+6) Fetch the state of the monster.
26158 JP MainLoop_Dispatch Jump to MainLoop_Dispatch to run the code for the state.
Prev: 26088 Up: Map Next: 26161