Answer the question
In order to leave comments, you need to log in
Why doesn't redraw work?
Hello!
I'm learning C++, using console graphics msofcon.h.
I realized that if two drawings are superimposed on each other, it turns out to be nonsense. The drawing begins to occupy neighboring cells with the one already drawn before it.
There is a traffic light.
It is drawn using the following method:
svetofor::svetofor(int xcen,int ycen)//конструктор светофора
{
radius=1;
set_color(cGREEN,cGREEN);
draw_circle(xcen+otsx,ycen+otsy,radius);
}
void svetofor::change(int c)//меняем цвет сетофора по команде
{
if (c==1){
set_color(cBLACK,cBLACK);
draw_circle(xcen+otsx,ycen+otsy,1);
set_color(cGREEN,cGREEN);
draw_circle(xcen+otsx,ycen+otsy,1);
}
else
{
set_color(cBLACK,cBLACK);
draw_circle(xcen+otsx,ycen+otsy,1);
set_color(cRED,cRED);
draw_circle(xcen+otsx,ycen+otsy,1);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question