I am trying to develop a game within the microprocessor curriculum, so the game is a doll that has to dodge bombs, so I have to create the doll, the bombs and get them to play. I already have a lot of code but I think it gets stuck in a while loop and I do not understand why. Is exposing here a piece of my code are able to help me ??
void main (void)
{
unsigned char i,counter=1;
start=0;
end=0;
IE=0b10000101;
En=1;
LCD_init ();
while(start!=0);
while(end==1);
Inicio();
CriarBonecoBomba();
x=0;
y=0;
score=0;
for(i=0;i<16;i++)
{
var[0][i]=' ';
var[1][i]=' ';
}
while(end==0) // salta da 1a interrupção la ao fundo para aqui e não sai daqui
{
while (start==1)
{
MovBoneco();
desloca_esq();
if((counter+3)%6==0)
cria_bomba(1);
else
if(counter%6==0)
cria_bomba(2);
else
cria_bomba(0);
if(var[y][x]==1|| 1==var[y][x-1])
{
LCD_comando(0b10000000);
LCD_date(' ');
LCD_date(' ');
LCD_date(' ');
LCD_date('G');
LCD_date('A');
LCD_date('M');
LCD_date('E');
LCD_date(' ');
LCD_date('O');
LCD_date('V');
LCD_date('E');
LCD_date('R');
while(1);
}
MovBoneco();
AtualizarLCD();
counter++;
if(var[0][0]==1||var[1][0]==1)
score=score+5;
display7segmentos();
}
}
}
void RSIEXT0(void)__interrupt (0)
{
start=1;
}
void RSIEXT1(void)__interrupt (2)
{
end==1;
}