Prev: 9035 Up: Map Next: 909A
9056: Test an object against the landscape, a little down and to the left
Used by the routines at move_bouncing, move_or_explode and probe_shot.
Moves the object 4 pixels left and 4 down (by setting its velocity to that, moving it with move_object and putting the velocity back), tests it against the landscape with collide_with_landscape, and moves it back. The 4-pixel offset lines the object's box up with its sprite. The mode collide_with_landscape tests in (piece_step_x) is the caller's: see move_bouncing and move_or_explode; the result is in scratch_count.
nudge_object moves the object by A pixels down and -A across, keeping its velocity, with the velocity saved in the four bytes at current_piece while it does.
Input
BC The box's height and width in pixels, for collide_with_landscape
test_landscape_at 9056 LD A,$04 Nudge it left and down
9058 PUSH BC
9059 CALL nudge_object
905C POP BC
905D CALL collide_with_landscape Test the landscape
9060 LD A,$FC And back
nudge_object 9062 LD H,(IX+$07) Keep its velocity
9065 LD L,(IX+$08)
9068 LD (current_piece),HL
906B LD H,(IX+$09)
906E LD L,(IX+$0A)
9071 LD ($DEDE),HL
9074 LD (IX+$09),A Velocity -A across, A down
9077 LD (IX+$0A),$00
907B NEG
907D LD (IX+$07),A
9080 LD (IX+$08),$00
9084 CALL move_object Move it
9087 LD HL,(current_piece) Put the velocity back
908A LD (IX+$07),H
908D LD (IX+$08),L
9090 LD HL,($DEDE)
9093 LD (IX+$09),H
9096 LD (IX+$0A),L
9099 RET
Prev: 9035 Up: Map Next: 909A