Witam, mam taki problem ponieważ bawię się w allegro w c++ i stworzyłem system kolizji. On ładnie działał aż do momentu. Nagle (zaraz przed wykrzaczeniem mi się windowsa(mam juz zainstalowanego na nowo)) przestały działać kolizje. oto mój kod:

#include <allegro.h>
int ludek_x = 100, ludek_y = 150;
int wall_w=100,wall_h=100, wall_x=250, wall_y=200;
int score=0;

int main()
{
    allegro_init();
    install_keyboard();
    set_color_depth( 32 );
    set_gfx_mode( GFX_AUTODETECT_WINDOWED, 1200,720, 0, 0 );
    clear_to_color( screen, makecol( 128, 128, 128 ) );

    BITMAP * ludek = NULL;
    BITMAP * bufor = NULL;
    BITMAP * domek = NULL;
    bufor = create_bitmap(1200,720);
    if( !bufor )
    {
        set_gfx_mode( GFX_TEXT, 0, 0, 0, 0 );
        allegro_message( "Nie mogę utworzyć bufora !" );
        allegro_exit();
        return 0;
    }

    ludek = load_bmp( "image/ludek.bmp", default_palette );
    if( !ludek )
    {
        set_gfx_mode( GFX_TEXT, 0, 0, 0, 0 );
        allegro_message( "nie mogę załadować obrazka Ludek !" );
        allegro_exit();
        return 0;
    }

    domek = load_bmp( "image/domek.bmp", default_palette );
    if( !domek )
    {
        set_gfx_mode( GFX_TEXT, 0, 0, 0, 0 );
        allegro_message( "nie mogę załadować obrazka Domek !" );
        allegro_exit();
        return 0;
    }

    while( !key[ KEY_ESC ] )
    {
            if( key[ KEY_LEFT ] )
                ludek_x--;
                for(int i=0; i<135;i++)
                    if(getpixel(bufor, ludek_x, ludek_y+i) == makecol(128,0,128))
                        ludek_x ++;


            if( key[ KEY_RIGHT ] )
                ludek_x++;
                for(int i=0; i<135;i++)
                    if(getpixel(bufor, ludek_x+41, ludek_y+i) == makecol(128,0,128))
                        ludek_x --;

            if( key[ KEY_UP ] )
                ludek_y--;
                for(int i=0; i<43;i++)
                {
                    if(getpixel(bufor, ludek_x+i, ludek_y) == makecol(128,0,128))
                        ludek_y ++;
                }

            if( key[ KEY_DOWN ] )
                ludek_y++;
                for(int i=0; i<43;i++)
                {
                    if(getpixel(bufor, ludek_x+i, ludek_y+131) == makecol(128,0,128))
                        ludek_y --;
                }
            if(ludek_y >= 483 && ludek_y <= 611 && ludek_x >= 499 && ludek_x <= 611)
                score++;

            if(ludek_x == 200 && ludek_y == 200)
                score++;

        clear_to_color( bufor, makecol( 150, 150, 150 ) );
        rest(10);
        masked_blit( domek, bufor, 0, 0, wall_x, wall_y, domek->w,domek->h);
        masked_blit( ludek, bufor, 0, 0, ludek_x, ludek_y, ludek->w, ludek->h );
        textprintf_ex( bufor, font, 2, 2, makecol( 0, 0, 255 ), - 1,"%d",ludek_x );
        textprintf_ex( bufor, font, 2, 10, makecol( 0, 0, 255 ), - 1,"%d",ludek_y );
        textprintf_ex( bufor, font, 2, 20, makecol( 0, 0, 255 ), - 1,"%d",score );
        blit( bufor, screen, 0, 0, 0, 0, 1200,720 );
    }
    readkey();
    destroy_bitmap( ludek );
    destroy_bitmap( bufor );
    allegro_exit();
    return 0;
}
END_OF_MAIN();

128,0,128 to są kolory obramowania mojego domku
domek:
user image

pętle w poruszaniu się są po to aby obejmowała kolizja całego ludzika(to też działało)
ludzik:
user image