.PlacePlayerOnLaunchpad LDR R0, [R11, #remainingLives] \ Set R0 to the number of remaining lives MOV R1, #30 \ Set (R1, R2) = (30, 1) so the following MOV R2, #1 \ call to PrintScoreInBothBanks prints the \ number of lives at column 30 on row 1 BL PrintScoreInBothBanks \ Print the number of lives in R0 at column \ 30 on row 1, just before the high score \ towards the right end of the score bar MVN R0, #0 \ Set playingGame = -1 to flag that the game STR R0, [R11, #playingGame] \ is being played and that this is not the \ crash animation MOV R0, #0 \ Set xCamera = 0 and zCamera = 0 STR R0, [R11, #xCamera] \ STR R0, [R11, #zCamera] \ This doesn't have any effect as the camera \ position is set at the start of the main \ loop by the call to MoveAndDrawPlayer, \ which overwrites these values STR R0, [R11, #shipDirection] \ Set shipDirection = 0 so the ship faces \ right when the game starts (though this is \ quickly corrected when the game uses the \ mouse coordinates to calculate the \ direction) MOV R0, #1 \ Set shipPitch = 1 so the ship is very STR R0, [R11, #shipPitch] \ slightly pitched up for take-off MOV R0, #LAUNCHPAD_SIZE/2 \ Set the starting coordinates of the MOV R2, R0 \ player's ship as follows: ADD R3, R11, #xPlayer \ MOV R1, #LAUNCHPAD_Y \ xPlayer = LAUNCHPAD_SIZE / 2 STMIA R3!, {R0-R2} \ yPlayer = LAUNCHPAD_Y \ zPlayer = LAUNCHPAD_SIZE / 2 \ \ which is in the middle of the launchpad MOV R0, #0 \ Set the player's velocity to zero as MOV R1, #0 \ follows: MOV R2, #0 \ STMIA R3!, {R0-R2} \ xVelocity = 0 \ yVelocity = 0 \ zVelocity = 0 BL ResetMousePosition \ Reset the mouse position to (511, 511), \ ready for the gameName: PlacePlayerOnLaunchpad [Show more] Type: Subroutine Category: Player Summary: The main entry point for the gameContext: See this subroutine in context in the source code References: This subroutine is called as follows: * LoseLife calls PlacePlayerOnLaunchpad
[X]
Configuration variable LAUNCHPAD_SIZE = TILE_SIZE * 8
Size of the launchpad (8 tile sizes)
[X]
Configuration variable LAUNCHPAD_Y = LAUNCHPAD_ALTITUDE - UNDERCARRIAGE_Y
The y-coordinate of the ship as it sits on the launchpad, and on top of its undercarriage
[X]
Subroutine PrintScoreInBothBanks (category: Score bar)
Print a number at a specified text column in the score bar
[X]
Subroutine ResetMousePosition (category: Player)
Reset the mouse position to (511, 511), ready for the game
[X]
Configuration variable playingGame = &130
A flag to determine whether the game is being player, or whether this is the crash animation
[X]
Configuration variable remainingLives = &134
The number of remaining lives, which is displayed towards the right end of the score bar, just before the high score
[X]
Configuration variable shipDirection = &154
The direction in which the player's ship faces, which is angle b in the rotation matrix, and which is determined by the angle of the mouse from the centre point
[X]
Configuration variable shipPitch = &158
The pitch of the player's ship, which is angle a in the rotation matrix, and which is determined by the distance of the mouse from the centre point
[X]
Configuration variable xCamera = &13C
The 3D x-coordinate of the camera position (though note that the camera position is actually at the back of the on-screen landscape, not the front)
[X]
Configuration variable xPlayer = &94
The x-coordinate of the player's ship
[X]
Configuration variable zCamera = &144
The 3D z-coordinate of the camera position (though note that the camera position is actually at the back of the on-screen landscape, not the front, so the camera's z-coordinate is larger than it would be for a more traditional camera position; it is more like the camera's focal point than position, in a sense)