![]() |
Routines |
| Prev: 52801 | Up: Map | Next: 53339 |
|
Used by the routine at GoldfishGame.
|
||||
|
The player has hit a sprite, let's see what it is.
|
||||
| GoldfishGame_Collision | 53238 | LD A,(56334) | C=*GoldfishGame_PlayerAttributes. | |
| 53241 | LD C,A | |||
| 53242 | LD A,(IX+0) | A=*IX+0. | ||
| 53245 | SUB (IX+7) | A-=*GoldfishGame_PlayerWidth. | ||
| 53248 | INC A | Increment A by one. | ||
| 53249 | SUB C | A-=C. | ||
| 53250 | CP 2 | Jump to GoldfishGame_NextCreature if A is higher than 2. | ||
| 53252 | JR NC,GoldfishGame_NextCreature | |||
| 53254 | PUSH IX | Stash IX on the stack. | ||
| 53256 | LD HL,100 | HL=0100. | ||
| 53259 | LD DE,100 | DE=0100. | ||
| 53262 | CALL 949 | Call BEEPER. | ||
| 53265 | POP IX | Restore IX from the stack. | ||
| 53267 | LD A,(IX+8) | Jump to GoldfishGame_HitCreature if *IX+8 is not equal to 1. | ||
| 53270 | CP 1 | |||
| 53272 | JR NZ,GoldfishGame_HitCreature | |||
|
The player has caught a fish! Add it to the count and remove it from the screen.
|
||||
| GoldfishGame_CaughtFish | 53274 | LD A,(56130) | Increment *GoldfishGame_FishCaught by one. | |
| 53277 | INC A | |||
| 53278 | LD (56130),A | |||
| 53281 | LD C,(IX+0) | C=Horizontal position (*IX+0). | ||
| 53284 | LD B,(IX+1) | B=Vertical position (*IX+1). | ||
| 53287 | LD E,(IX+7) | E=*IX+7. | ||
| 53290 | LD D,(IX+8) | D=*IX+8. | ||
| 53293 | LD A,(IX+2) | Jump to GoldfishGame_Collision_0 if *IX+2 is equal to 3. | ||
| 53296 | CP 3 | |||
| 53298 | JR Z,GoldfishGame_Collision_0 | |||
| 53300 | INC E | Increment E by one. | ||
| GoldfishGame_Collision_0 | 53301 | LD HL,40812 | Write 40812 (Graphics_MaskSprite) to *CHARS. | |
| 53304 | LD (23606),HL | |||
| 53307 | LD A,32 | A=32. | ||
| 53309 | CALL GoldfishGame_PrintSprite | Call GoldfishGame_PrintSprite. | ||
| 53312 | LD (IX+10),0 | Write inactive (0) to *IX+10. | ||
| 53316 | JP GoldfishGame_NextCreature | Jump to GoldfishGame_NextCreature. | ||
|
When any sea creature touches you they steal all of your fish.
|
||||
| GoldfishGame_HitCreature | 53319 | XOR A | Write 0 to *GoldfishGame_FishCaught. | |
| 53320 | LD (56130),A | |||
| 53323 | PUSH IX | Stash IX on the stack. | ||
| 53325 | LD HL,200 | HL=0200. | ||
| 53328 | LD DE,50 | DE=0050. | ||
| 53331 | CALL 949 | Call BEEPER. | ||
| 53334 | POP IX | Restore IX from the stack. | ||
| 53336 | JP GoldfishGame_NextCreature | Jump to GoldfishGame_NextCreature. | ||
| Prev: 52801 | Up: Map | Next: 53339 |