Lession 4 "homework" bug / glitch?

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
boozfob
Posts: 7
Joined: June 8th, 2012, 2:22 pm
Location: Somewhere in sweden

Lession 4 "homework" bug / glitch?

Post by boozfob » June 21st, 2012, 1:52 pm

Hi chili , im watching your videos and they are awesome :)
but in the 4th u had the homework thing with changing where the crosshair is and the colour i did it without problem but found something i cant explain in any way :3

Look at this code

Code: Select all

/****************************************************************************************** 
 *	Chili DirectX Framework Version 11.12.17											  *	
 *	Game.cpp																			  *
 *	Copyright 2011 PlanetChili.net														  *
 *																						  *
 *	This file is part of The Chili DirectX Framework.									  *
 *																						  *
 *	The Chili DirectX Framework is free software: you can redistribute it and/or modify	  *
 *	it under the terms of the GNU General Public License as published by				  *
 *	the Free Software Foundation, either version 3 of the License, or					  *
 *	(at your option) any later version.													  *
 *																						  *
 *	The Chili DirectX Framework is distributed in the hope that it will be useful,		  *
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of						  *
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the						  *
 *	GNU General Public License for more details.										  *
 *																						  *
 *	You should have received a copy of the GNU General Public License					  *
 *	along with The Chili DirectX Framework.  If not, see <http://www.gnu.org/licenses/>.  *
 ******************************************************************************************/
#include "Game.h"

Game::Game( HWND hWnd,const KeyboardServer& kServer )
:	gfx ( hWnd ),
	kbd( kServer )
{}

void Game::Go()
{
	gfx.BeginFrame();
	ComposeFrame();
	gfx.EndFrame();
}

void Game::ComposeFrame()
{
	int x;
	int y;
	int b;
	
	x = 400;
	y = 300;
	b = 255;
	if( kbd.RightIsPressed() )
	{
		x = 500;
	}
	if( kbd.LeftIsPressed() )
	{
		x = 300;
	}
	if( kbd.DownIsPressed() )
	{
		y = 400;
	}
	if( kbd.UpIsPressed() )
	{
		y = 200;
	}
	
	if( kbd.SpaceIsPressed() )
	{
		b = 0;
	}
	gfx.PutPixel( x,y,255,255,b );
	gfx.PutPixel( -5 + x,y,255,255,b );
	gfx.PutPixel( -4 + x,y,255,255,b );
	gfx.PutPixel( -3 + x,y,255,255,b );
	gfx.PutPixel( 3 + x,y,255,255,b );
	gfx.PutPixel( 2 + x,y,255,255,b );
	gfx.PutPixel( 1 + x,y,255,255,b );
	gfx.PutPixel( x,-5 + y,255,255,b );
	gfx.PutPixel( x,-4 + y,255,255,b );
	gfx.PutPixel( x,-3 + y,255,255,b );
	gfx.PutPixel( x,3 + y,255,255,b );
	gfx.PutPixel( x,2 + y,255,255,b );
	gfx.PutPixel( x,1 + y,255,255,b );


}
If i use that i can move the crosshair in all 9 difrent positions and i can colour it yellow while pressing space.. But when i colour it yellow i cant move it the the left upper corner and if i move it there while white, then nothing happens when i press space.. so while white i can move it in 9 positions and while yellow i can move it in 8 positions, very confusing and thanks in advance :)
My computer specs : Gtx 580 sparkle edition | i5 2500k | h100 cooling | Antec 1200 chassi| 6gb of cheap RAM | Gigabyte P67A-UD4 B3 | LG 23" TFT W2363D-PF 120Hz |

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Lession 4 "homework" bug / glitch?

Post by LuX » June 21st, 2012, 1:53 pm

http://www.microsoft.com/appliedscience ... ained.mspx

Test out the keys and see if it detects all presses.
ʕ •ᴥ•ʔ

User avatar
boozfob
Posts: 7
Joined: June 8th, 2012, 2:22 pm
Location: Somewhere in sweden

Re: Lession 4 "homework" bug / glitch?

Post by boozfob » June 21st, 2012, 1:59 pm

Hmm but why just left + up + space? :O
then it feels like right + up + space shouldnt work eaither, but it does :3
My computer specs : Gtx 580 sparkle edition | i5 2500k | h100 cooling | Antec 1200 chassi| 6gb of cheap RAM | Gigabyte P67A-UD4 B3 | LG 23" TFT W2363D-PF 120Hz |

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Lession 4 "homework" bug / glitch?

Post by LuX » June 21st, 2012, 2:00 pm

Maybe it changes sometimes. And the order you press the keys does matter.
ʕ •ᴥ•ʔ

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

Re: Lession 4 "homework" bug / glitch?

Post by chili » June 21st, 2012, 2:10 pm

I gotta put an annotation on that video....
Chili

User avatar
XxWalKaxX
Posts: 244
Joined: June 11th, 2012, 7:15 pm

Re: Lession 4 "homework" bug / glitch?

Post by XxWalKaxX » June 22nd, 2012, 1:35 am

post the rest of your code it is probably something simple, when i did it everything worked fine, try starting over with a fresh copy of the framework, its possible that you could have accidentally changed something without realizing it
What you call a bug...I call a new feature!

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

Re: Lession 4 "homework" bug / glitch?

Post by chili » June 22nd, 2012, 4:25 pm

Nah WalKax, like lux says it's probably ghosting.
Chili

Post Reply