gracias ya imprime la matriz y el tablero de opciones ahora lo que necesito es saber como hago para arrastrar los objetos de la paleta conel mouse hasta mi matriz.
bueno pero ahi les mando lo que llevo del codigo
#include<allegro.h>
void tablero(void)
{
int i;
for(i=9;i<599;i+=50)
line(screen,i,0,i,599,0);
for(i=0;i<599;i+=50)
line(screen,9,i,599,i,0);
}
void presionar(int *bn,int *p)
{
int x,y;
rectfill(screen,30,285,80,335,27);
line(screen,30,285,80,285,0);
line(screen,80,285,85,280,0);
rect(screen,30,280,85,335,0);
circlefill(screen,56,309,20,0);
x=mouse_x;
y=mouse_y;
if((x>30)&&(x<85))
if((y>280)&&(y<335))
*bn=1;
*p=0;
}
void teclas(int l)
{
if(l==1)
{
rectfill(screen,30,280,85,335,24);
rect(screen,30,280,85,335,0);
circlefill(screen,57,307,20,0);
}
else
{
rectfill(screen,110,280,165,335,24);
rect(screen,110,280,165,335,0);
rectfill(screen,115,205,160,250,40);
}
}
int main(void)
{
int x,y,press=0,n=0;
allegro_init();
set_gfx_mode(GFX_AUTODETECT_WINDOWED,800,600,0,0);
install_keyboard();
install_mouse();
install_timer();
//---------------------------------------------------------------
rectfill(screen,0,0,799,599,15);
//---------------------------------------------------------------
rectfill(screen,0,0,199,599,30);
rectfill(screen,5,5,194,594,27);
line(screen,0,0,5,5,27);
line(screen,0,199,5,194,27);
line(screen,199,599,194,594,27);
line(screen,0,599,5,594,27);
//---------------------------------------------------------------
rectfill(screen,30,200,85,255,24);
rect(screen,30,200,85,255,0);
//---------------------------------------------------------------
rectfill(screen,110,200,165,255,24);
rect(screen,110,200,165,255,0);
//---------------------------------------------------------------
teclas(1);
//---------------------------------------------------------------
teclas(2);
//---------------------------------------------------------------
tablero();
//---------------------------------------------------------------
scare_mouse();
show_mouse(screen);
while(!key[KEY_ESC])
{
if(mouse_b&1)
press=1;
else
if(n==0)
if(press==1)
presionar(&n,&press);
if(mouse_b&1)
press=1;
else
if(n==1)
if(press==1)
{
x=mouse_x;
y=mouse_y;
teclas(1);
circlefill(screen,x,y,20,0);
n=0;
press=0;
}
}
allegro_exit();
}
END_OF_MAIN();