@@ -579,11 +579,29 @@ void move_ghosts() {
579
579
580
580
}
581
581
582
+ // finishes frightened state for ghosts
583
+ inline void end_frightened () {
584
+ sonido2Sirena ();
585
+ pill_eaten = NONE ;
586
+ for (idx = 0 ; idx != 4 ; ++ idx ) {
587
+ if (ghosts [idx ]-> active == FRIGHTENED ) {
588
+ ghosts [idx ]-> active = CHASE ;
589
+ reset_colors (ghosts [idx ]);
590
+ }
591
+ }
592
+ sp1_IterateSprChar (ghost_red .sp , initialiseColourGhostRed );
593
+ sp1_IterateSprChar (ghost_cyan .sp , initialiseColourGhostCyan );
594
+ sp1_IterateSprChar (ghost_magenta .sp , initialiseColourGhostMagenta );
595
+ sp1_IterateSprChar (ghost_yellow .sp , initialiseColourYellow );
596
+ }
597
+
582
598
583
599
void next_level () {
600
+ stop_ay ();
584
601
resetSiren ();
585
602
sonido3InsertCoin ();
586
603
++ level ;
604
+ end_frightened ();
587
605
// helps determining scatter mode changes and some others
588
606
slowticker = 0 ;
589
607
++ reached_level ;
@@ -745,18 +763,7 @@ void check_fsm() {
745
763
}
746
764
747
765
if (pill_eaten == 0 ) {
748
- sonido2Sirena ();
749
- pill_eaten = NONE ;
750
- for (idx = 0 ; idx != 4 ; ++ idx ) {
751
- if (ghosts [idx ]-> active == FRIGHTENED ) {
752
- ghosts [idx ]-> active = CHASE ;
753
- reset_colors (ghosts [idx ]);
754
- }
755
- }
756
- sp1_IterateSprChar (ghost_red .sp , initialiseColourGhostRed );
757
- sp1_IterateSprChar (ghost_cyan .sp , initialiseColourGhostCyan );
758
- sp1_IterateSprChar (ghost_magenta .sp , initialiseColourGhostMagenta );
759
- sp1_IterateSprChar (ghost_yellow .sp , initialiseColourYellow );
766
+ end_frightened ();
760
767
}
761
768
762
769
if (cherry .showing > 0 ) {
0 commit comments