Prev: CEA0 Up: Map Next: CEDA
CEA3: Run Slider X
The handler of the object type 57, which is a block that goes backwards and forwards along x. It moves 02 for each frame, carrying anything that stands on it, and turns around when it is stopped. Bit 0 of the number at 10 of its record is the direction that it is going in.
Input
IX Object record
RunSliderX CEA3 CALL SetSpriteOffset_Minus16_Minus8 Call SetSpriteOffset_Minus16_Minus8 to set the offsets of the sprite.
CEA6 XOR A Set the speeds along y and z to zero.
CEA7 LD (IX+$0A),A
CEAA LD (IX+$0B),A
Go towards the end of the run, or turn around if the block is stopped.
CEAD BIT 0,(IX+$10) Jump to RunSliderX_Start if the block is going to the start.
CEB1 JR Z,RunSliderX_Start
CEB3 LD (IX+$09),$02 Set the speed along x to 02.
CEB7 CALL ApplyGravityAndMove_Move Call ApplyGravityAndMove_Move to move the block, without gravity.
CEBA BIT 0,(IX+$0C) Jump to RunSliderX_Finish if the block was not stopped along x.
CEBE JR Z,RunSliderX_Finish
CEC0 RES 0,(IX+$10) Make the block go to the start.
RunSliderX_Finish CEC4 JP SetWipeAndDrawFlags Jump to SetWipeAndDrawFlags to flag the block as moved.
Go towards the start of the run.
RunSliderX_Start CEC7 LD (IX+$09),$FE Set the speed along x to FE.
CECB CALL ApplyGravityAndMove_Move Call ApplyGravityAndMove_Move to move the block, without gravity.
CECE BIT 0,(IX+$0C) Jump to RunSliderX_Finish if the block was not stopped along x.
CED2 JR Z,RunSliderX_Finish
CED4 SET 0,(IX+$10) Make the block go to the end.
CED8 JR RunSliderX_Finish Jump to RunSliderX_Finish to finish.
Prev: CEA0 Up: Map Next: CEDA