I was wondering if someone could let me know if I'm on the right track for the homework of episode 9. I feel like I'm putting a lot of effort into something I shouldn't. We just learned how to make loops using the
Code: Select all
while()
Code: Select all
void Game::ComposeFrame()
{
int x = 250;
while( x < 550 )
{
gfx.PutPixel( x,300,255,255,255 );
x++;
}
int x2 = 250;
while( x2 < 550 )
{
gfx.PutPixel( x2,301,255,255,255 );
x2++;
}
int x3 = 250;
while( x3 < 550 )
{
gfx.PutPixel( x3,302,255,255,255 );
x3++;
}
int x4 = 250;
while( x4 < 550 )
{
gfx.PutPixel( x4,303,255,255,255 );
x4++;
}
int x5 = 250;
while( x5 < 550 )
{
gfx.PutPixel( x5,304,255,255,255 );
x5++;
}
int x6 = 250;
while( x6 < 550 )
{
gfx.PutPixel( x6,305,255,255,255 );
x6++;
}
int x7 = 250;
while( x7 < 550 )
{
gfx.PutPixel( x7,306,255,255,255 );
x7++;
}
int x8 = 250;
while( x8 < 550 )
{
gfx.PutPixel( x8,307,255,255,255 );
x8++;
}
int x9 = 250;
while( x9 < 550 )
{
gfx.PutPixel( x9,308,255,255,255 );
x9++;
}
int x10 = 250;
while( x10 < 550 )
{
gfx.PutPixel( x10,309,255,255,255 );
x10++;
}
int x11 = 250;
while( x11 < 550 )
{
gfx.PutPixel( x11,310,255,255,255 );
x11++;
}
int x12 = 250;
while( x12 < 550 )
{
gfx.PutPixel( x12,311,255,255,255 );
x12++;
}
int x13 = 250;
while( x13 < 550 )
{
gfx.PutPixel( x13,312,255,255,255 );
x13++;
}
int x14 = 250;
while( x14 < 550 )
{
gfx.PutPixel( x14,313,255,255,255 );
x14++;
}
int x15 = 250;
while( x15 < 550 )
{
gfx.PutPixel( x15,314,255,255,255 );
x15++;
}
int x16 = 250;
while( x16 < 550 )
{
gfx.PutPixel( x16,315,255,255,255 );
x16++;
}
int x17 = 250;
while( x17 < 550 )
{
gfx.PutPixel( x17,316,255,255,255 );
x17++;
}
int x18 = 250;
while( x18 < 550 )
{
gfx.PutPixel( x18,317,255,255,255 );
x18++;
}
int x19 = 250;
while( x19 < 550 )
{
gfx.PutPixel( x19,318,255,255,255 );
x19++;
}
int x20 = 250;
while( x20 < 550 )
{
gfx.PutPixel( x20,319,255,255,255 );
x20++;
}
int x21 = 250;
while( x21 < 550 )
{
gfx.PutPixel( x21,320,255,255,255 );
x21++;
}
int x22 = 250;
while( x22 < 550 )
{
gfx.PutPixel( x22,321,255,255,255 );
x22++;
}
int x23 = 250;
while( x23 < 550 )
{
gfx.PutPixel( x23,322,255,255,255 );
x23++;
}
int x24 = 250;
while( x24 < 550 )
{
gfx.PutPixel( x24,323,255,255,255 );
x24++;
}
int x25 = 250;
while( x25 < 550 )
{
gfx.PutPixel( x25,324,255,255,255 );
x25++;
}
int x26 = 250;
while( x26 < 550 )
{
gfx.PutPixel( x26,325,255,255,255 );
x26++;
}
int x27 = 250;
while( x27 < 550 )
{
gfx.PutPixel( x27,326,255,255,255 );
x27++;
}
int x28 = 250;
while( x28 < 550 )
{
gfx.PutPixel( x28,327,255,255,255 );
x28++;
}
int x29 = 250;
while( x29 < 550 )
{
gfx.PutPixel( x29,328,255,255,255 );
x29++;
}
int x30 = 250;
while( x30 < 550 )
{
gfx.PutPixel( x30,329,255,255,255 );
x30++;
}
int x31 = 250;
while( x31 < 550 )
{
gfx.PutPixel( x31,330,255,255,255 );
x31++;
}
int x32 = 250;
while( x32 < 550 )
{
gfx.PutPixel( x32,331,255,255,255 );
x32++;
}
int x33 = 250;
while( x33 < 550 )
{
gfx.PutPixel( x33,332,255,255,255 );
x33++;
}
int x34 = 250;
while( x34 < 550 )
{
gfx.PutPixel( x34,333,255,255,255 );
x34++;
}
int x35 = 250;
while( x35 < 550 )
{
gfx.PutPixel( x35,334,255,255,255 );
x35++;
}
int x36 = 250;
while( x36 < 550 )
{
gfx.PutPixel( x36,335,255,255,255 );
x36++;
}
int x37 = 250;
while( x37 < 550 )
{
gfx.PutPixel( x37,336,255,255,255 );
x37++;
}
int x38 = 250;
while( x38 < 550 )
{
gfx.PutPixel( x38,337,255,255,255 );
x38++;
}
int x39 = 250;
while( x39 < 550 )
{
gfx.PutPixel( x39,338,255,255,255 );
x39++;
}
int x40 = 250;
while( x40 < 550 )
{
gfx.PutPixel( x40,339,255,255,255 );
x40++;
}
}
Can someone steer me in the right direction?
Cheers