I'm doing a simple Frogger game for my subject, but my code have a problem that i dont know how to fix it. I've been using mvprintw in a function to move a "object" across the map in the same direction ever, but when it finished the first full map and begins again it scrolling up one line, how can i avoid that scrolling?
Heres the object function:
void rand_obj1 (int y)
init_pair (3, COLOR_RED , COLOR_CYAN);
mvprintw (20,y, " _ _ _ _");
mvprintw (21,y, "() _ )");
mvprintw (22,y, "()_ _ _ _)");
mvprintw (10,y, " _ _ _ _");
mvprintw (11,y, "() _ )");
mvprintw (12,y, "()_ _ _ _)");
And the loop that a used on my main fuction to show the map e reset the coordinate to object walk throguh all over the begin again:
if (y >= max_x) y=0;
There's nothing in the given example which would do what is described.
Your program (in the parts not shown) is probably writing messages to the terminal with
printf, and these messages are not seen (or taken into account) by the curses library.
For instance, it could be in this call:
lago is not the cause. Running the sample program shows that it uses an extra line (due to wraparound), giving a total of 23 lines. Normally this is not a problem, but suppose that your terminal is 23 lines (which could happen) and if you had also set the environment variable
LINES to 24 (also possible), then you'd see wrapping as shown in this picture:
The mismatch is possible for instance if you had configured the terminal to start with 23 lines (or are running it via an IDE which did this for you) and noticed some problem and then set the environment variable to fix this. The environment variable overrides curses' notion of the screensize (though that can be altered using