Prev: 44927 Up: Map Next: 44983
44936: Initialise Game
Used by the routine at StartGame.
Sets up everything needed to start a new game: builds the lookup tables, gives the player five lives, lets the player choose the control method on the menu, plays the start tune and then picks the random start location of the player and of the special objects.
Build the tables and set the starting state.
InitialiseGame 44936 CALL BuildLookupTables Call BuildLookupTables.
44939 XOR A Write 0 to NotFirstRoomFlag.
44940 LD (23474),A
44943 LD (53613),A Write 0 to the counter and flags byte of the player copy at 53613.
44946 LD A,5 Set Lives to 5.
44948 LD (23482),A
44951 LD HL,23456 Point HL at RandomSeed1.
44954 LD A,(23458) Fetch the low byte of FrameCounter.
44957 ADD A,(HL) Add it to RandomSeed1.
44958 LD (HL),A
Show the menu and wait for the player to start.
44959 CALL ClearScreen Call ClearScreen.
44962 CALL GameMenu Call GameMenu.
44965 LD DE,45582 Point DE at StartGameTune.
44968 CALL PlayMusic Call PlayMusic.
Place the player and set up the rooms.
44971 CALL ShuffleRequiredObjects Call ShuffleRequiredObjects.
44974 CALL InitialisePlayer Call InitialisePlayer.
44977 CALL InitialiseSun Call InitialiseSun.
44980 CALL InitialiseSpecialObjects Call InitialiseSpecialObjects.
Continue on to StartLife.
Prev: 44927 Up: Map Next: 44983