Prev: 28332 Up: Map Next: 28405
28352: Land Hit Actor
Used by the routine at MoveHitActor.
Part of MoveHitActor, used when the actor has reached the bottom of the play area (a vertical co-ordinate of 160 or more). The mixing bowl and the four dustbins are along the bottom of the screen, and the actor is tested against them with TestLandingPosition. This depends on the vertical co-ordinate of the actor:
Vertical co-ordinate What happens
160 to 183 Nothing, if the actor is over the bowl or a dustbin; otherwise it bounces off the gap (see LandHitActor_Bounce)
184 to 191 The actor is over the bowl (see CatchHitActor), over a dustbin (see RemoveFallenActor_Pillar), or bounces off the gap (see LandHitActor_Bounce)
192 or more See TestFallenActor
Input
A The new vertical co-ordinate
IX Actor
LandHitActor 28352 LD (IX+2),A Update the vertical co-ordinate.
28355 INC (IX+7) Increase the counter in byte 7 of the actor by one, to make up for it being decreased.
28358 CP 192 Jump to TestFallenActor if the actor has gone as far as the bottom.
28360 JR NC,TestFallenActor
28362 CP 184 Jump to LandHitActor_BottomRow if the actor is on the bottom row.
28364 JR NC,LandHitActor_BottomRow
28366 CALL TestLandingPosition Test the position of the actor using TestLandingPosition.
28369 RET NC Return if the actor is over the bowl or a dustbin.
The actor is over a gap, so make it bounce.
LandHitActor_Bounce 28370 LD A,(IX+2) Fetch the vertical co-ordinate.
28373 CP 168 Jump to LandHitActor_Rebound if the actor is 168 or lower.
28375 JR NC,LandHitActor_Rebound
28377 LD (IX+5),252 Set the vertical speed to 252 (-4, to bounce the actor upwards).
28381 JR MoveHitActor_TestHorizontalSpeed Jump to MoveHitActor_TestHorizontalSpeed.
The actor is low down in the gap, so make it move the other way.
LandHitActor_Rebound 28383 LD A,(IX+4) Fetch the horizontal speed.
28386 NEG Reverse the direction by negating the horizontal speed.
28388 LD (IX+4),A Update the horizontal speed.
28391 LD (IX+5),4 Set the vertical speed to 4 (moving down).
28395 RET Return.
The actor is on the bottom row.
LandHitActor_BottomRow 28396 CALL TestLandingPosition Test the position of the actor using TestLandingPosition.
28399 JR C,LandHitActor_Bounce Jump to LandHitActor_Bounce if the actor is over a gap.
28401 LD A,B Fetch the result of the landing test (zero for the bowl).
28402 AND A Is the actor over the bowl?
28403 JR NZ,RemoveFallenActor_Pillar Jump to RemoveFallenActor_Pillar if it is over a dustbin.
Prev: 28332 Up: Map Next: 28405