wishdeath Temat założony przez niniejszego użytkownika |
[C++,winGBIm] Powtarzanie obrazu » 2014-10-06 23:06:59 #include<graphics.h> #include<stdio.h>
void czolg( int x ) { int w; w = 4; int prostokat[ 8 ] = { x, 10, x + 10, 10, x + 10, 50, x, 50, }; setfillstyle( SOLID_FILL, BLUE ); int prostokat2[ 8 ] = { x + 10, 20, x + 30, 20, x + 30, 45, x + 10, 45 }; int prostokat3[ 8 ] = { x + 18, 2, x + 22, 2, x + 22, 20, x + 18, 20 }; int prostokat4[ 8 ] = { x + 17, 0, x + 23, 0, x + 23, 2, x + 17, 2 }; int prostokat5[ 8 ] = { x + 30, 10, x + 40, 10, x + 40, 50, x + 30, 50 }; fillpoly( w, prostokat ); fillpoly( w, prostokat2 ); fillpoly( w, prostokat3 ); fillpoly( w, prostokat4 ); fillpoly( w, prostokat5 ); } void zamalowanie() { int w; w = 4; int prostokat[ 8 ] = { 0, 10, 10, 10, 10, 50, 0, 50, }; setfillstyle( SOLID_FILL, BLACK ); int prostokat2[ 8 ] = { 10, 20, 30, 20, 30, 45, 10, 45 }; int prostokat3[ 8 ] = { 18, 2, 22, 2, 22, 20, 18, 20 }; int prostokat4[ 8 ] = { 17, 0, 23, 0, 23, 2, 17, 2 }; int prostokat5[ 8 ] = { 30, 10, 40, 10, 40, 50, 30, 50 }; setcolor( BLACK ); fillpoly( w, prostokat ); fillpoly( w, prostokat2 ); fillpoly( w, prostokat3 ); fillpoly( w, prostokat4 ); fillpoly( w, prostokat5 ); }; int main() { int i; int maxW, maxH; initwindow( 800, 600 ); for( i = 0; i <= 800; i + 80 ) czolg( i ); getch(); }
Moim celem jest narysowanie czołgów na calej szerokosci okna graficznego w odstepie miedzy sobą 80pix, aczkolwiek po wielu probach nie widze postepu w mojej pracy. |