![]() |
Routines |
| Prev: B3BD | Up: Map | Next: B420 |
|
Types 0A and 16: the outlaw who is wanted at this level. A bullet hit sets OutlawShotFlag to one, which makes FinishTownStage end the stage. Otherwise the outlaw wanders about the town: if he touches the sheriff, the sheriff dies. Type 16 is made by CreateOutlaw instead of type 0A when the outlaw is to be a little faster.
|
||||
|
Check whether a bullet has hit the outlaw.
|
||||
| HandleOutlaw | B3DA | CALL CheckBulletHit | Check whether a bullet has hit the outlaw. | |
| B3DD | JR NC,HandleOutlaw_Walk | Jump to HandleOutlaw_Walk if not. | ||
| B3DF | LD A,$01 | Set OutlawShotFlag. | ||
| B3E1 | LD ($A20A),A | |||
| B3E4 | JR HandleOutlaw_Draw | Jump to HandleOutlaw_Draw to draw the outlaw. | ||
|
Check whether the outlaw has touched the sheriff, and make him wander.
|
||||
| HandleOutlaw_Walk | B3E6 | CALL CheckSheriffTouch | Check whether the outlaw is touching the sheriff. | |
| B3E9 | JP C,KillSheriff | Kill the sheriff if he is. | ||
| B3EC | LD A,(IX+$05) | Fetch the speed of the outlaw. | ||
| B3EF | CALL SetSpeedsFromHeading | Set the speeds from it. | ||
| B3F2 | LD A,(IX+$07) | Fetch the flags of the outlaw. | ||
| B3F5 | PUSH AF | Stash them on the stack. | ||
| B3F6 | CALL TestMove | Move around any walls. | ||
| B3F9 | POP AF | Retrieve the flags. | ||
| B3FA | CALL PlayFootstepSound | Make a footstep sound if a foot has gone down. | ||
| B3FD | CALL MoveObject | Move the outlaw. | ||
| B400 | CALL UpdateDirection | Choose a new direction every so often. | ||
| B403 | CALL SetFacingFlags | Set the direction the outlaw faces. | ||
| B406 | CALL NextSpriteNumber | Move on to the next frame of the walk. | ||
|
Make the sprites for the outlaw.
|
||||
| HandleOutlaw_Draw | B409 | CALL ChooseFigureSprites | Choose the sprites for the figure. | |
| B40C | EX AF,AF' | Keep the sprite number in the alternate accumulator. | ||
| B40D | LD L,A | Keep the sprite number in L. | ||
| B40E | LD A,($A260) | Fetch the level. | ||
| B411 | ADD A,A | Double it. | ||
| B412 | AND %00000110 | Keep two bits. | ||
| B414 | JR NZ,HandleOutlaw_AddSpriteSet | Jump to HandleOutlaw_AddSpriteSet unless the sprite set is the first. | ||
| B416 | LD A,$02 | Use the second sprite set. | ||
| HandleOutlaw_AddSpriteSet | B418 | ADD A,L | Add the sprite set to the sprite number. | |
| B419 | EX AF,AF' | Keep the number in the alternate accumulator. | ||
| B41A | LD HL,$A232 | Point HL at OutlawSpriteList. | ||
| B41D | JP BuildFigureSpriteList | Jump to BuildFigureSpriteList. | ||
| Prev: B3BD | Up: Map | Next: B420 |