Cześć,co mogę zrobić żeby pozbyć się tła mojej postaci na ekranie? To mój kod:
#include <allegro.h>
int main()
{
allegro_init();
install_keyboard();
set_color_depth( 8 );
set_gfx_mode( GFX_AUTODETECT, 800, 600, 0, 0 );
set_palette( default_palette );
clear_to_color( screen, makecol(255,0,255) );
BITMAP * ludek = NULL;
ludek=load_bmp("ludek.bmp",NULL);
if( !ludek )
{
set_gfx_mode( GFX_TEXT, 0, 0, 0, 0 );
allegro_message( "nie moge zaladować obrazka 1 !" );
allegro_exit();
return 0;
}
int ludek_x=100; int ludek_y=100;
while( !key[ KEY_ESC ] )
{
if( key[ KEY_LEFT ] ) ludek_x--;
if( key[ KEY_RIGHT ] ) ludek_x++;
if( key[ KEY_UP ] ) ludek_y--;
if( key[ KEY_DOWN ] ) ludek_y++;
rest(2);
masked_blit(ludek,screen,0,0,ludek_x,ludek_y,ludek->w,ludek->h);
}
destroy_bitmap(ludek);
readkey();
allegro_exit();
return 0;
}
END_OF_MAIN();
Użytkownik RSWT edytował ten post 27.05.2016 - 15:01