while( !key[ KEY_ESC ] )
{
if( mouse_b == 1 && mg == false ) magazynek--; mg = true;
if( mouse_b == 2 ) magazynek = 5;
if( mouse_b != 1 ) mg = false;
if( magazynek <= 0 ) magazynek = 0;
if( magazynek <= 0 ) textprintf( bufor, font, 500, 350, makecol( 0, 0, 0 ), "Magazynek Pusty!" );
if( magazynek <= 0 ) textprintf( bufor, font, 500, 370, makecol( 0, 0, 0 ), "Nacisnij PPM aby przeładować!" );
clear_to_color( bufor, makecol( 255, 255, 255 ) );
textprintf_ex( bufor, font, 20, 20, makecol( 0, 0, 0 ), - 1, "x: %d, y: %d, button: %d", mouse_x, mouse_y, mouse_b );
textprintf_ex( bufor, font, 20, 40, makecol( 0, 0, 0 ), - 1, "Magazynek: %d", magazynek );
textprintf_ex( bufor, font, 20, 60, makecol( 0, 0, 0 ), - 1, "Punkty: %d", punkty );
blit( ziemia, bufor, 0, 0, 0, 600, ziemia->w, ziemia->h );
masked_blit( kulka1, bufor, 0, 0, kula1.x, kula1.y, kulka1->w, kulka1->h );
masked_blit( kulka2, bufor, 0, 0, kula2.x, kula2.y, kulka2->w, kulka2->h );
masked_blit( kulka3, bufor, 0, 0, kula3.x, kula3.y, kulka3->w, kulka3->h );
masked_blit( kulka4, bufor, 0, 0, kula4.x, kula4.y, kulka4->w, kulka4->h );
masked_blit( kulka5, bufor, 0, 0, kula5.x, kula5.y, kulka5->w, kulka5->h );
masked_blit( celownik, bufor, 0, 0, mouse_x, mouse_y, celownik->w, celownik->h );
blit( bufor, screen, 0, 0, 0, 0, 1024, 768 );
clear_keybuf();