Skip to navigation

Gameplay: MoveOnToNextEnemy

Name: MoveOnToNextEnemy [Show more] Type: Subroutine Category: Gameplay Summary: Update enemyObject so the next time we consider applying enemy tactics, we apply them to the next enemy, looping from 7 to 0
.MoveOnToNextEnemy JSR GetNextSeedNumber \ Set A to the next number from the landscape's sequence \ of seed numbers DEC enemyObject \ Decrement the number of the enemy object that we are \ considering for tactics, so the next iteration of the \ gameplay loop will apply tactics to the next enemy BPL next1 \ If enemyObject is positive then it is still in the \ range 0 to 7, so jump to next1 to skip the following LDA #7 \ Set enemyObject = 7 to wrap the enemy number back up STA enemyObject \ to 7, so it iterates from 7 down to 0 and then back \ to 7 again .next1 LDA playerObject \ Set viewingObject to the object number of the player, STA viewingObject \ so any future view calculations are done from the \ aspect of the player rather than the enemy object \ (until we return to apply tactics to the next enemy) RTS \ Return from the subroutine