Bug in homework for Beginner C++ Game Programming Tutorial 3

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
warnakey
Posts: 10
Joined: October 26th, 2016, 6:34 am

Bug in homework for Beginner C++ Game Programming Tutorial 3

Post by warnakey » October 26th, 2016, 6:48 am

Hi there,

I did the homework for lesson 3 (https://www.youtube.com/watch?v=xWLcp_yOpww) - probably horribly, but it works - and I noticed a weird error. I originally set my bool for changing the colors in the 9 positions to be controlled by pressing the space bar instead of the CTRL button, and the top left and bottom right positions did not change color when I pressed the space bar, even though all the other positions worked.

I then switched the color change bool to work when I press the CTRL button and everything worked properly. What is going on there? Why does CTRL work for all 9 positions, but not space bar?

Here is the solution I came up with (with the space bar bug included):

-----------------------

Code: Select all

   int x = 400; //SORRY THIS CODE IS SO LONG :|
	int y = 300;

	const bool up = wnd.kbd.KeyIsPressed(VK_UP);
	const bool down = wnd.kbd.KeyIsPressed(VK_DOWN);
	const bool left = wnd.kbd.KeyIsPressed(VK_LEFT);
	const bool right = wnd.kbd.KeyIsPressed(VK_RIGHT);
	const bool shapeshift = wnd.kbd.KeyIsPressed(VK_SHIFT);
	const bool colorshift = wnd.kbd.KeyIsPressed(VK_SPACE);

	if (up) {
		if (left) {
			if (colorshift) {
				int x = 300;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 300;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 300;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
		else if (right) {
			if (colorshift) {
				int x = 500;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 500;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 500;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
		else {
			if (colorshift) {
				int x = 400;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 400;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 400;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
	}
	else if (left) {
		if (up) {
			if (colorshift) {
				int x = 500;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 300;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 300;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
		else if (down) {
			if (colorshift) {
				int x = 300;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 300;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 300;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
		else {
			if (colorshift) {
				int x = 300;
				int y = 300;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 300;
				int y = 300;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 300;
				int y = 300;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
	}
	else if (right) {
		if (up) {
			if (colorshift) {
				int x = 500;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 500;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 500;
				int y = 200;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
		else if (down) {
			if (colorshift) {
				int x = 500;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 500;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 500;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
		else {
			if (colorshift) {
				int x = 500;
				int y = 300;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 500;
				int y = 300;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 500;
				int y = 300;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
	}
	else if (down) {
		if (left) {
			if (colorshift) {
				int x = 300;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 300;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 300;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
		else if (right) {
			if (colorshift) {
				int x = 500;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else if (shapeshift) {
				int x = 500;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 255, 255, 255);
				gfx.PutPixel(-5 + x, y, 255, 255, 255);
				gfx.PutPixel(-4 + x, y, 255, 255, 255);
				gfx.PutPixel(-3 + x, y, 255, 255, 255);
				gfx.PutPixel(-2 + x, y, 255, 255, 255);
				gfx.PutPixel(-1 + x, y, 255, 255, 255);
				gfx.PutPixel(0 + x, y, 255, 255, 255);
				gfx.PutPixel(1 + x, y, 255, 255, 255);
				gfx.PutPixel(2 + x, y, 255, 255, 255);
				gfx.PutPixel(3 + x, y, 255, 255, 255);
				gfx.PutPixel(4 + x, y, 255, 255, 255);
				gfx.PutPixel(5 + x, y, 255, 255, 255);
				gfx.PutPixel(6 + x, y, 255, 255, 255);
				gfx.PutPixel(x, -6 + y, 255, 255, 255);
				gfx.PutPixel(x, -5 + y, 255, 255, 255);
				gfx.PutPixel(x, -4 + y, 255, 255, 255);
				gfx.PutPixel(x, -3 + y, 255, 255, 255);
				gfx.PutPixel(x, -2 + y, 255, 255, 255);
				gfx.PutPixel(x, -1 + y, 255, 255, 255);
				gfx.PutPixel(x, 0 + y, 255, 255, 255);
				gfx.PutPixel(x, 1 + y, 255, 255, 255);
				gfx.PutPixel(x, 2 + y, 255, 255, 255);
				gfx.PutPixel(x, 3 + y, 255, 255, 255);
				gfx.PutPixel(x, 4 + y, 255, 255, 255);
				gfx.PutPixel(x, 5 + y, 255, 255, 255);
				gfx.PutPixel(x, 6 + y, 255, 255, 255);
			}
			else {
				int x = 500;
				int y = 400;
				gfx.PutPixel(-6 + x, y, 200, 55, 25);
				gfx.PutPixel(-5 + x, y, 200, 55, 25);
				gfx.PutPixel(-4 + x, y, 200, 55, 25);
				gfx.PutPixel(-3 + x, y, 200, 55, 25);
				gfx.PutPixel(3 + x, y, 200, 55, 25);
				gfx.PutPixel(4 + x, y, 200, 55, 25);
				gfx.PutPixel(5 + x, y, 200, 55, 25);
				gfx.PutPixel(6 + x, y, 200, 55, 25);
				gfx.PutPixel(x, -6 + y, 200, 55, 25);
				gfx.PutPixel(x, -5 + y, 200, 55, 25);
				gfx.PutPixel(x, -4 + y, 200, 55, 25);
				gfx.PutPixel(x, -3 + y, 200, 55, 25);
				gfx.PutPixel(x, 3 + y, 200, 55, 25);
				gfx.PutPixel(x, 4 + y, 200, 55, 25);
				gfx.PutPixel(x, 5 + y, 200, 55, 25);
				gfx.PutPixel(x, 6 + y, 200, 55, 25);
			}
		}
		else if (colorshift) {
			int x = 400;
			int y = 400;
			gfx.PutPixel(-6 + x, y, 255, 255, 255);
			gfx.PutPixel(-5 + x, y, 255, 255, 255);
			gfx.PutPixel(-4 + x, y, 255, 255, 255);
			gfx.PutPixel(-3 + x, y, 255, 255, 255);
			gfx.PutPixel(3 + x, y, 255, 255, 255);
			gfx.PutPixel(4 + x, y, 255, 255, 255);
			gfx.PutPixel(5 + x, y, 255, 255, 255);
			gfx.PutPixel(6 + x, y, 255, 255, 255);
			gfx.PutPixel(x, -6 + y, 255, 255, 255);
			gfx.PutPixel(x, -5 + y, 255, 255, 255);
			gfx.PutPixel(x, -4 + y, 255, 255, 255);
			gfx.PutPixel(x, -3 + y, 255, 255, 255);
			gfx.PutPixel(x, 3 + y, 255, 255, 255);
			gfx.PutPixel(x, 4 + y, 255, 255, 255);
			gfx.PutPixel(x, 5 + y, 255, 255, 255);
			gfx.PutPixel(x, 6 + y, 255, 255, 255);
		}
		else if (shapeshift) {
			int x = 400;
			int y = 400;
			gfx.PutPixel(-6 + x, y, 255, 255, 255);
			gfx.PutPixel(-5 + x, y, 255, 255, 255);
			gfx.PutPixel(-4 + x, y, 255, 255, 255);
			gfx.PutPixel(-3 + x, y, 255, 255, 255);
			gfx.PutPixel(-2 + x, y, 255, 255, 255);
			gfx.PutPixel(-1 + x, y, 255, 255, 255);
			gfx.PutPixel(0 + x, y, 255, 255, 255);
			gfx.PutPixel(1 + x, y, 255, 255, 255);
			gfx.PutPixel(2 + x, y, 255, 255, 255);
			gfx.PutPixel(3 + x, y, 255, 255, 255);
			gfx.PutPixel(4 + x, y, 255, 255, 255);
			gfx.PutPixel(5 + x, y, 255, 255, 255);
			gfx.PutPixel(6 + x, y, 255, 255, 255);
			gfx.PutPixel(x, -6 + y, 255, 255, 255);
			gfx.PutPixel(x, -5 + y, 255, 255, 255);
			gfx.PutPixel(x, -4 + y, 255, 255, 255);
			gfx.PutPixel(x, -3 + y, 255, 255, 255);
			gfx.PutPixel(x, -2 + y, 255, 255, 255);
			gfx.PutPixel(x, -1 + y, 255, 255, 255);
			gfx.PutPixel(x, 0 + y, 255, 255, 255);
			gfx.PutPixel(x, 1 + y, 255, 255, 255);
			gfx.PutPixel(x, 2 + y, 255, 255, 255);
			gfx.PutPixel(x, 3 + y, 255, 255, 255);
			gfx.PutPixel(x, 4 + y, 255, 255, 255);
			gfx.PutPixel(x, 5 + y, 255, 255, 255);
			gfx.PutPixel(x, 6 + y, 255, 255, 255);
		}
		else {
			int x = 400;
			int y = 400;
			gfx.PutPixel(-6 + x, y, 200, 55, 25);
			gfx.PutPixel(-5 + x, y, 200, 55, 25);
			gfx.PutPixel(-4 + x, y, 200, 55, 25);
			gfx.PutPixel(-3 + x, y, 200, 55, 25);
			gfx.PutPixel(3 + x, y, 200, 55, 25);
			gfx.PutPixel(4 + x, y, 200, 55, 25);
			gfx.PutPixel(5 + x, y, 200, 55, 25);
			gfx.PutPixel(6 + x, y, 200, 55, 25);
			gfx.PutPixel(x, -6 + y, 200, 55, 25);
			gfx.PutPixel(x, -5 + y, 200, 55, 25);
			gfx.PutPixel(x, -4 + y, 200, 55, 25);
			gfx.PutPixel(x, -3 + y, 200, 55, 25);
			gfx.PutPixel(x, 3 + y, 200, 55, 25);
			gfx.PutPixel(x, 4 + y, 200, 55, 25);
			gfx.PutPixel(x, 5 + y, 200, 55, 25);
			gfx.PutPixel(x, 6 + y, 200, 55, 25);
		}
	}
	else if (colorshift) {
		gfx.PutPixel(-6 + x, y, 255, 255, 255);
		gfx.PutPixel(-5 + x, y, 255, 255, 255);
		gfx.PutPixel(-4 + x, y, 255, 255, 255);
		gfx.PutPixel(-3 + x, y, 255, 255, 255);
		gfx.PutPixel(3 + x, y, 255, 255, 255);
		gfx.PutPixel(4 + x, y, 255, 255, 255);
		gfx.PutPixel(5 + x, y, 255, 255, 255);
		gfx.PutPixel(6 + x, y, 255, 255, 255);
		gfx.PutPixel(x, -6 + y, 255, 255, 255);
		gfx.PutPixel(x, -5 + y, 255, 255, 255);
		gfx.PutPixel(x, -4 + y, 255, 255, 255);
		gfx.PutPixel(x, -3 + y, 255, 255, 255);
		gfx.PutPixel(x, 3 + y, 255, 255, 255);
		gfx.PutPixel(x, 4 + y, 255, 255, 255);
		gfx.PutPixel(x, 5 + y, 255, 255, 255);
		gfx.PutPixel(x, 6 + y, 255, 255, 255);
	}
	else if (shapeshift) {
		gfx.PutPixel(-6 + x, y, 255, 255, 255);
		gfx.PutPixel(-5 + x, y, 255, 255, 255);
		gfx.PutPixel(-4 + x, y, 255, 255, 255);
		gfx.PutPixel(-3 + x, y, 255, 255, 255);
		gfx.PutPixel(-2 + x, y, 255, 255, 255);
		gfx.PutPixel(-1 + x, y, 255, 255, 255);
		gfx.PutPixel(0 + x, y, 255, 255, 255);
		gfx.PutPixel(1 + x, y, 255, 255, 255);
		gfx.PutPixel(2 + x, y, 255, 255, 255);
		gfx.PutPixel(3 + x, y, 255, 255, 255);
		gfx.PutPixel(4 + x, y, 255, 255, 255);
		gfx.PutPixel(5 + x, y, 255, 255, 255);
		gfx.PutPixel(6 + x, y, 255, 255, 255);
		gfx.PutPixel(x, -6 + y, 255, 255, 255);
		gfx.PutPixel(x, -5 + y, 255, 255, 255);
		gfx.PutPixel(x, -4 + y, 255, 255, 255);
		gfx.PutPixel(x, -3 + y, 255, 255, 255);
		gfx.PutPixel(x, -2 + y, 255, 255, 255);
		gfx.PutPixel(x, -1 + y, 255, 255, 255);
		gfx.PutPixel(x, 0 + y, 255, 255, 255);
		gfx.PutPixel(x, 1 + y, 255, 255, 255);
		gfx.PutPixel(x, 2 + y, 255, 255, 255);
		gfx.PutPixel(x, 3 + y, 255, 255, 255);
		gfx.PutPixel(x, 4 + y, 255, 255, 255);
		gfx.PutPixel(x, 5 + y, 255, 255, 255);
		gfx.PutPixel(x, 6 + y, 255, 255, 255);
	}
	else {
		gfx.PutPixel(-6 + x, y, 200, 55, 25);
		gfx.PutPixel(-5 + x, y, 200, 55, 25);
		gfx.PutPixel(-4 + x, y, 200, 55, 25);
		gfx.PutPixel(-3 + x, y, 200, 55, 25);
		gfx.PutPixel(3 + x, y, 200, 55, 25);
		gfx.PutPixel(4 + x, y, 200, 55, 25);
		gfx.PutPixel(5 + x, y, 200, 55, 25);
		gfx.PutPixel(6 + x, y, 200, 55, 25);
		gfx.PutPixel(x, -6 + y, 200, 55, 25);
		gfx.PutPixel(x, -5 + y, 200, 55, 25);
		gfx.PutPixel(x, -4 + y, 200, 55, 25);
		gfx.PutPixel(x, -3 + y, 200, 55, 25);
		gfx.PutPixel(x, 3 + y, 200, 55, 25);
		gfx.PutPixel(x, 4 + y, 200, 55, 25);
		gfx.PutPixel(x, 5 + y, 200, 55, 25);
		gfx.PutPixel(x, 6 + y, 200, 55, 25);
	}

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Bug in homework for Beginner C++ Game Programming Tutori

Post by chili » October 26th, 2016, 6:51 am

Welcome to the forum. Here is a welcoming link for you: https://www.youtube.com/watch?v=UrK_KPY ... be&t=0m29s

:lol:
Chili

User avatar
warnakey
Posts: 10
Joined: October 26th, 2016, 6:34 am

Re: Bug in homework for Beginner C++ Game Programming Tutori

Post by warnakey » October 26th, 2016, 6:59 am

Thanks chili.

Yep, it turns out my keyboard hates it when I press UP+LEFT+SPACE or DOWN+RIGHT+SPACE, but totally doesn't mind every other combination.

Weird, but now I know.

Pho_Cup
Posts: 2
Joined: June 25th, 2017, 9:34 am

Re: Bug in homework for Beginner C++ Game Programming Tutori

Post by Pho_Cup » June 25th, 2017, 9:50 am

Hey Chilinarians, I have a similar problem where everything works except when I press UP+LEFT+SHIFT or UP+RIGHT+SHIFT. My code is relatively short (less than 100 lines):

{
int x;
int y;
int r, g, b;

if (wnd.kbd.KeyIsPressed(VK_UP))
{
y = -100;
}
else if (wnd.kbd.KeyIsPressed(VK_DOWN))
{
y = 100;
}
else
{
y = 0;
}

if (wnd.kbd.KeyIsPressed(VK_LEFT))
{
x = -100;
}
else if (wnd.kbd.KeyIsPressed(VK_RIGHT))
{
x = 100;
}
else
{
x = 0;
}

if (wnd.kbd.KeyIsPressed(VK_SHIFT))
{
r = 255;
g = 0;
b = 255;
}
else
{
r = 255;
g = 255;
b = 255;
}

if (wnd.kbd.KeyIsPressed(VK_SPACE))
{
gfx.PutPixel(x + 395, y + 303, r, g, b);
gfx.PutPixel(x + 395, y + 304, r, g, b);
gfx.PutPixel(x + 395, y + 305, r, g, b);
gfx.PutPixel(x + 396, y + 305, r, g, b);
gfx.PutPixel(x + 397, y + 305, r, g, b);

gfx.PutPixel(x + 403, y + 305, r, g, b);
gfx.PutPixel(x + 404, y + 305, r, g, b);
gfx.PutPixel(x + 405, y + 305, r, g, b);
gfx.PutPixel(x + 405, y + 304, r, g, b);
gfx.PutPixel(x + 405, y + 303, r, g, b);

gfx.PutPixel(x + 395, y + 297, r, g, b);
gfx.PutPixel(x + 395, y + 296, r, g, b);
gfx.PutPixel(x + 395, y + 295, r, g, b);
gfx.PutPixel(x + 396, y + 295, r, g, b);
gfx.PutPixel(x + 397, y + 295, r, g, b);

gfx.PutPixel(x + 405, y + 297, r, g, b);
gfx.PutPixel(x + 405, y + 296, r, g, b);
gfx.PutPixel(x + 405, y + 295, r, g, b);
gfx.PutPixel(x + 404, y + 295, r, g, b);
gfx.PutPixel(x + 403, y + 295, r, g, b);
}
else
{
gfx.PutPixel(x + 395, y + 300, r, g, b);
gfx.PutPixel(x + 396, y + 300, r, g, b);
gfx.PutPixel(x + 397, y + 300, r, g, b);

gfx.PutPixel(x + 403, y + 300, r, g, b);
gfx.PutPixel(x + 404, y + 300, r, g, b);
gfx.PutPixel(x + 405, y + 300, r, g, b);

gfx.PutPixel(x + 400, y + 295, r, g, b);
gfx.PutPixel(x + 400, y + 296, r, g, b);
gfx.PutPixel(x + 400, y + 297, r, g, b);

gfx.PutPixel(x + 400, y + 303, r, g, b);
gfx.PutPixel(x + 400, y + 304, r, g, b);
gfx.PutPixel(x + 400, y + 305, r, g, b);
}
}

User avatar
Zedtho
Posts: 189
Joined: February 14th, 2017, 7:32 pm

Re: Bug in homework for Beginner C++ Game Programming Tutori

Post by Zedtho » June 25th, 2017, 1:03 pm

There are clusters of keyboard input on keyboards, so it's probably because they're in the same cluster.
https://www.microsoft.com/appliedscienc ... ained.mspx
for more information.
Otherwise it might be a bug in the chili framework, although I doubt that, since my program worked.

Pho_Cup
Posts: 2
Joined: June 25th, 2017, 9:34 am

Re: Bug in homework for Beginner C++ Game Programming Tutori

Post by Pho_Cup » June 26th, 2017, 12:16 am

Thanks for that! I learned a lot from reading that, then plugged in my G910 keyboard and it overcame the problem. :geek:

User avatar
Zedtho
Posts: 189
Joined: February 14th, 2017, 7:32 pm

Re: Bug in homework for Beginner C++ Game Programming Tutori

Post by Zedtho » June 26th, 2017, 8:53 am

So it fixed it? Awesome :D

Post Reply