.tact18 \ If we get here then we need to rotate enemy #X TXA \ Check to see whether it is safe to redraw object #X JSR AbortWhenVisible \ without risk of corrupting a screen pan (if there is \ a risk and it can't be updated, then the call to \ AbortWhenVisible will not return here and will instead \ abort tactics for this iteration of the gameplay loop) LDA objectYawAngle,X \ Set objectYawAngle = objectYawAngle + enemyYawStep CLC \ ADC enemyYawStep,X \ So this rotates the enemy by the yaw angle in this STA objectYawAngle,X \ enemy's enemyYawStep variable LDA #200 \ Set enemyRotateTimer for the enemy to 200 so we wait STA enemyRotateTimer,X \ for 200 * 0.06 = 12 seconds before rotating the enemy \ again JSR ResetMeanieScan \ Reset the data stored for any meanie scans that the \ enemy has tried in the past, so the enemy can start \ looking for potential meanies with a clean slate LDX #7 \ Set X = 7 to pass to MakeSound-6 as the pitch of the \ first part of the rotating enemy sound LDY #120 \ Set Y = 70 to pass to MakeSound-6 as the pitch of the \ second part of the rotating enemy sound LDA #0 \ Make sound #0 (rotating enemy) with the pitches in X JSR MakeSound-6 \ and Y LDX enemyObject \ Set X to the object number of the enemy to which we \ are applying tactics JMP tact26 \ Jump to tact26 to draw the updated object #X without a \ dithered effect, so the enemy rotates instantly if it \ is on the screenName: ApplyTactics (Part 6 of 8) [Show more] Type: Subroutine Category: Gameplay Summary: Rotate the enemy and make a rotation soundContext: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
[X]
Subroutine AbortWhenVisible (category: Gameplay)
Abort applying the tactics for this gameplay loop if updating the object on-screen will corrupt a screen pan
[X]
Entry point MakeSound-6 in subroutine MakeSound (category: Sound)
Make a two-part sound at the pitches defined in X and Y, where X is the pitch for sound data block #0 and Y is the pitch for sound data block #1
[X]
Subroutine ResetMeanieScan (category: Gameplay)
Reset the data stored for any meanie scans that the enemy has tried in the past, so we can start looking with a clean slate
[X]
Variable enemyObject in workspace Zero page
The object number of the enemy to which we are applying tactics in this iteration around the main loop (0-7)
[X]
Variable enemyRotateTimer in workspace Main variable workspace
A timer for each enemy that counts down every 0.06
[X]
Variable enemyYawStep (category: 3D objects)
The yaw angle through which each enemy rotates on each scheduled rotation
[X]
Variable objectYawAngle (category: 3D objects)
The yaw angle for each object (i.e. the horizontal direction in which they are facing)
[X]
Label tact26 in subroutine ApplyTactics (Part 8 of 8)