Prev: 24835 Up: Map Next: 24908
24868: Dynamic pause
Control the speed of animation by pausing when things aren't happening. So if there's no spaceship being animated we pause slightly to keep speed consistent with when there is a spaceship on screen. Same for when we need to animate the player's ship moving, and the player's bullet.
Used by the routine at start.
dynamic_pause 24868 LD A,(_SPACESHIP_DIRECTION) Is there a spaceship on screen? If there isn't we pause a moment to control speed. If there is we skip that pause
24871 OR A
24872 JR NZ,dynamic_pause_0
24874 LD A,(_SPACESHIP_SPEED_FACTOR) Load A with speed factor
24877 CALL delay_ms Busy wait a multiple of 'A' states
dynamic_pause_0 24880 LD A,(_YPOS_ADJUST) Do we need to move and redraw the player ship this iteration? If not, we pause.
24883 OR A
24884 JR NZ,dynamic_pause_1
24886 LD A,(_PLAYER_SPEED_FACTOR) Load A with speed factor
24889 CALL delay_ms Busy wait a multiple of 'A' states
dynamic_pause_1 24892 LD A,(_PLAYER_BULLET_IN_FLIGHT) Is there a bullet is in flight? If not we need to pause here too.
24895 OR A
24896 JP NZ,game_loop
24899 LD A,(_BULLET_SPEED_FACTOR) Load A with speed factor
24902 CALL delay_ms Busy wait a multiple of 'A' states
24905 JP game_loop Back to game loop
Prev: 24835 Up: Map Next: 24908