Skip to navigation


Car geometry: MovePlayer

Name: MovePlayer [Show more] Type: Subroutine Category: Car geometry Summary: Move the player's car forwards or backwards by one segment
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * MovePlayerBack calls MovePlayer * MovePlayerForward calls MovePlayer

Arguments: C flag Controls the direction of movement: * Clear = move the car in the direction it is pointing (i.e. drive forwards) * Set = reverse the car
.MovePlayer LDX currentPlayer \ Set X to the driver number of the current player ROR A \ If just one of the C flag and bit 7 of directionFacing EOR directionFacing \ is set (but not both), jump to play1 to move the car BMI play1 \ backwards along the track \ \ In other words, we move backwards if: \ \ * C is clear and the car is facing backwards along \ the track, in which case it is driving forwards \ but going backwards around the track \ \ * C is set and the car is facing forwards along the \ track, in which case it is reversing along the \ track while facing forwards JSR MoveObjectForward \ Move the current player forwards by one segment RTS \ Return from the subroutine .play1 JSR MoveObjectBack \ Move current player backwards by one segment RTS \ Return from the subroutine