HELP WITH LESSON 12!!

The Partridge Family were neither partridges nor a family. Discuss.
chilipotatoe
Posts: 7
Joined: June 9th, 2012, 12:17 pm

HELP WITH LESSON 12!!

Post by chilipotatoe » June 9th, 2012, 1:32 pm

Hi guys. This is my first post.

okay umm.... I'm on lesson 12 ( tic tac toe game). And I'm typing everything right. I quadrouple check. But when i try to draw the grid, and the circle and the x. some of the lines are missing. I posted a screen shot so you guys can see.
Attachments
fail tic tac toe.zip
This is the code
(4.91 MiB) Downloaded 160 times
fail.png
(4.95 KiB) Downloaded 146 times
Last edited by chilipotatoe on June 9th, 2012, 1:53 pm, edited 4 times in total.

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

Re: HELP WITH LESSON 12!!

Post by LuX » June 9th, 2012, 1:35 pm

Well...?
Upload some code so we can help.

And do read this: http://www.planetchili.net/forum/viewtopic.php?f=3&t=2

By a fraction of a second, chili, by a fraction.
ʕ •ᴥ•ʔ

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

Re: HELP WITH LESSON 12!!

Post by chili » June 9th, 2012, 1:35 pm

Don't see any screenshot bro. Anyways, screenshots interest me not. Read the forum rules and then post your zipped cleaned solution.
Chili

chilipotatoe
Posts: 7
Joined: June 9th, 2012, 12:17 pm

Re: HELP WITH LESSON 12!!

Post by chilipotatoe » June 9th, 2012, 1:51 pm

Sorry. I dont know why the screenshot wasn't working before, but now it should. And I added my code. I'm still getting used to the site.

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

Re: HELP WITH LESSON 12!!

Post by LuX » June 9th, 2012, 2:34 pm

Took some time since I was making food. But your code in Game.cpp is a'ok : -)

But then...

...What the fuck is going on in D3DGraphics?!

Looks really weird in there and I wasn't even able to run it properly. Or maybe it's the ghillie version of the framework? Anyways. Go through the beginning of the D3DGraphics.cpp and .h again. The problem lies somewhere there.
ʕ •ᴥ•ʔ

chilipotatoe
Posts: 7
Joined: June 9th, 2012, 12:17 pm

Re: HELP WITH LESSON 12!!

Post by chilipotatoe » June 9th, 2012, 2:55 pm

I have a modified version that chili made, because my computer sucks. So maybe thats why its weird? idk
i'm actually new to this programming thing, and i dont really know much.

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

Re: HELP WITH LESSON 12!!

Post by LuX » June 9th, 2012, 3:00 pm

Alright, well I see where your problem is now. This one has happened to someone before, but look at your draw line function in D3D.

Code: Select all

float m = (float)dx / (float)dy; 
		float b = x1 - m * y1;                 //<--------- "b" defined as line equation
		for ( int y = y1; y <= y2; y++ )
	   {
		  int x = m*y + b + 0.5f;
		  PutPixel ( x,y,r,g,b );                //<---------- "b" is not blue in this case!
	   }
Notice how you use variable "b" for two purposes. What you need to do is rename either one.
ʕ •ᴥ•ʔ

chilipotatoe
Posts: 7
Joined: June 9th, 2012, 12:17 pm

Re: HELP WITH LESSON 12!!

Post by chilipotatoe » June 9th, 2012, 3:52 pm

Now i get this; error C2065: 'blue' : undeclared identifier

all i did was change the b in putpixel to blue in the d3d.h and the d3d.cpp

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

Re: HELP WITH LESSON 12!!

Post by LuX » June 9th, 2012, 4:23 pm

Without seeing where and what you changed exactly its hard to say where the error is, but basically the computer doesn't know what "blue" is unless you tell it by writing something like "int blue"
ʕ •ᴥ•ʔ

chilipotatoe
Posts: 7
Joined: June 9th, 2012, 12:17 pm

Re: HELP WITH LESSON 12!!

Post by chilipotatoe » June 9th, 2012, 4:33 pm

umm could you please tell me how to change a variable then? because i dont think i fully understand. sorry for being such a noob

Post Reply