Prev: 52896 Up: Map Next: 52954
52899: Run Slider X
The handler of the object type 87, which is a block that goes backwards and forwards along x. It moves 2 for each frame, carrying anything that stands on it, and turns around when it is stopped. Bit 0 of the number at 16 of its record is the direction that it is going in.
Input
IX Object record
RunSliderX 52899 CALL SetSpriteOffset_Minus16_Minus8 Call SetSpriteOffset_Minus16_Minus8 to set the offsets of the sprite.
52902 XOR A Set the speeds along y and z to zero.
52903 LD (IX+10),A
52906 LD (IX+11),A
Go towards the end of the run, or turn around if the block is stopped.
52909 BIT 0,(IX+16) Jump to RunSliderX_Start if the block is going to the start.
52913 JR Z,RunSliderX_Start
52915 LD (IX+9),2 Set the speed along x to 2.
52919 CALL ApplyGravityAndMove_Move Call ApplyGravityAndMove_Move to move the block, without gravity.
52922 BIT 0,(IX+12) Jump to RunSliderX_Finish if the block was not stopped along x.
52926 JR Z,RunSliderX_Finish
52928 RES 0,(IX+16) Make the block go to the start.
RunSliderX_Finish 52932 JP SetWipeAndDrawFlags Jump to SetWipeAndDrawFlags to flag the block as moved.
Go towards the start of the run.
RunSliderX_Start 52935 LD (IX+9),254 Set the speed along x to 254.
52939 CALL ApplyGravityAndMove_Move Call ApplyGravityAndMove_Move to move the block, without gravity.
52942 BIT 0,(IX+12) Jump to RunSliderX_Finish if the block was not stopped along x.
52946 JR Z,RunSliderX_Finish
52948 SET 0,(IX+16) Make the block go to the end.
52952 JR RunSliderX_Finish Jump to RunSliderX_Finish to finish.
Prev: 52896 Up: Map Next: 52954