.ApplyTactics LDA enemyTacticTimer,X \ If enemyTacticTimer >= 2 for this enemy, then jump to CMP #2 \ MoveOnToNextEnemy to jump to MoveOnToNextEnemy to BCS MoveOnToNextEnemy \ stop applying tactics to this enemy and set things up \ so we move on to the next enemy in the next iteration \ of the gameplay loop \ If we get here then enemyTacticTimer for this enemy \ has counted down to be less than 2, so it's time to \ apply tactics to the enemy LDA #4 \ Set enemyTacticTimer for the enemy to 4 so by default STA enemyTacticTimer,X \ we wait for 4 * 0.06 = 0.6 seconds before applying \ tactics to the enemy again (though we may change this) LDA #20 \ Set enemyViewingArc = 20, so the enemy's gaze has a STA enemyViewingArc \ viewing arc that's the same width as the screen (as \ the screen is 20 yaw angles across) LDA enemyMeanieTree,X \ Fetch the value of enemyMeanieTree for the enemy we \ are processing, so A contains tells us whether the \ enemy has turned a tree into a meanie BPL tact1 \ If bit 7 of enemyMeanieTree is clear then the enemy \ has turned a tree into a meanie, so jump to part 2 to \ apply tactics to the meanie JMP tact6 \ Bit 7 of enemyMeanieTree is set so the enemy has not \ turned a tree into a meanie, so jump to part 3 to skip \ the meanie tactics routineName: ApplyTactics (Part 1 of 8) [Show more] Type: Subroutine Category: Gameplay Summary: Apply tactics to the Sentinel or a sentryContext: See this subroutine in context in the source code References: This subroutine is called as follows: * ApplyEnemyTactics calls ApplyTactics
Arguments: X The object number of the Sentinel or sentry to which we apply tactics (0 to 7) enemyObject Contains the same as X
[X]
Subroutine MoveOnToNextEnemy (category: Gameplay)
Update enemyObject so the next time we consider applying enemy tactics, we apply them to the next enemy, looping from 7 to 0
[X]
Variable enemyMeanieTree in workspace Main variable workspace
Enemy has turned a tree into a meanie (one byte per
[X]
Variable enemyTacticTimer in workspace Main variable workspace
A timer for each enemy that counts down every 0.06
[X]
Variable enemyViewingArc in workspace Main variable workspace
The viewing arc of the enemy that is being processed in the ApplyTactics routine
[X]
Label tact1 in subroutine ApplyTactics (Part 2 of 8)
[X]
Label tact6 in subroutine ApplyTactics (Part 3 of 8)