Skip to navigation

Gameplay: ApplyTactics (Part 6 of 8)

Name: ApplyTactics (Part 6 of 8) [Show more] Type: Subroutine Category: Gameplay Summary: Rotate the enemy and make a rotation sound
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
.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 screen