Disable leaveok() and adjust messages to properly position cursor.
authorMatthew Mondor <mmondor@pulsar-zone.net>
Mon, 10 Apr 2023 21:19:20 +0000 (21:19 +0000)
committerMatthew Mondor <mmondor@pulsar-zone.net>
Mon, 10 Apr 2023 21:19:20 +0000 (21:19 +0000)
src/main.cpp
src/mishaps.cpp

index 6af4b5b..264d193 100644 (file)
@@ -588,9 +588,10 @@ int main(int argc, char *argv[]){
   int smartbombs = 2;
   int drawlaser = 0;
 
-  cbreak();
-  noecho();
-  nonl();
+  (void)cbreak();
+  (void)noecho();
+  (void)nonl();
+  (void)leaveok(win, FALSE);
   (void)keypad(win, TRUE);
   (void)intrflush(stdscr, FALSE);
   (void)curs_set(0);
@@ -1074,7 +1075,7 @@ int main(int argc, char *argv[]){
     if(input=='q'){
     char quit;
     clear();
-    printw("Really quit (y/n)? ");
+    printw("Really quit (y/n) ? ");
     refresh();
     for (quit = ERR; quit != 'y' && quit != 'n'; quit = block_getch()) ;
     if(quit=='y'){
@@ -1163,7 +1164,7 @@ int main(int argc, char *argv[]){
       pause_game = 0;
       while(pause_game!=' '){
        display_controls();
-       mvprintw(10,25,"Paused.  Press SPACE to continue.\n");
+       mvprintw(10,25,"Paused.  Press SPACE to continue. ");
        refresh();
        pause_game = block_getch();
       };
@@ -1979,14 +1980,14 @@ int main(int argc, char *argv[]){
          //Print goodies, getch
          pause_game = 0;
          while(pause_game!=' '){
-           mvprintw(10,20,"Level %d Completed.  Press SPACE to continue.\n", level);
+           mvprintw(10,20,"Level %d Completed.  Press SPACE to continue. ", level);
            refresh();
            pause_game = block_getch();
          };
          if(level==24){
            pause_game = 'f';
            while(pause_game!=' '){
-             mvprintw(11,21,"Victory!!!! Score: %d Press SPACE to exit\n", score);
+             mvprintw(11,21,"Victory!!!! Score: %d Press SPACE to exit", score);
              refresh();
              pause_game = block_getch();
              loopvar = 1;
index 4d37530..ba20807 100644 (file)
@@ -86,7 +86,7 @@ int life_loss(int lives, int score){
   if(lives>=1){
     pause_game = 0;
     while(pause_game!=' '){
-      mvprintw(10,20,"Boom.  Press SPACE to continue.\n");
+      mvprintw(10,20,"Boom.  Press SPACE to continue. ");
       refresh();
       pause_game = block_getch();
     };
@@ -119,10 +119,10 @@ int life_loss(int lives, int score){
     };
     
     while(pause_game!='y'&&pause_game!='n'){
-      mvprintw(10,20,"GAME OVER. Score:%d  Play again(y/n)?\n", score);
       if(score>hscore){
        mvprintw(11,20,"High Score: %s", outstring);
       };
+      mvprintw(10,20,"GAME OVER. Score:%d  Play again (y/n) ? ", score);
       refresh();
       pause_game = block_getch();
     };