You are on page 1of 1

#include <winbgim.

h>
#include <iostream>
using namespace std;
void waitForLeftMouseClick();
void f1(int x, int y);
void cabeza(int x, int y);
void dib();
int x=100;
int y=100;
int main()
{
initwindow(1000,1000); //open a 400x300 graphics window

// delete these lines and replace them with your own code:

dib();

// while(!kbhit()); // wait for user to press a key


waitForLeftMouseClick(); // use one or the other of these--not both

closegraph(); //close graphics window


return 0;
}
void f1(int x, int y)
{
setfillstyle(8, 1 );
bar(x,y,x+400,y+70);
line (x+350,100,x+350,y);
line(x+100,100,x+350,100);
line(x+100,100,200,200);
line(x+350,150,400,100);
}
void cabeza(int x, int y)
{
circle(x,y,40);

}
void waitForLeftMouseClick()
{
clearmouseclick(WM_LBUTTONDOWN);
const int DELAY = 50; // Milliseconds of delay between checks
int x, y;
while (!ismouseclick(WM_LBUTTONDOWN))
delay(DELAY);
getmouseclick(WM_LBUTTONDOWN, x, y);
}
void dib()
{
f1(x,y+500);
delay(50);
cabeza(x+100,y+140);

You might also like