HELP WITH LESSON 12!!
-
- Posts: 7
- Joined: June 9th, 2012, 12:17 pm
HELP WITH LESSON 12!!
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.
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.
Re: HELP WITH LESSON 12!!
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.
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.
ʕ •ᴥ•ʔ
Re: HELP WITH LESSON 12!!
Don't see any screenshot bro. Anyways, screenshots interest me not. Read the forum rules and then post your zipped cleaned solution.
Chili
-
- Posts: 7
- Joined: June 9th, 2012, 12:17 pm
Re: HELP WITH LESSON 12!!
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.
Re: HELP WITH LESSON 12!!
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.
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.
ʕ •ᴥ•ʔ
-
- Posts: 7
- Joined: June 9th, 2012, 12:17 pm
Re: HELP WITH LESSON 12!!
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.
i'm actually new to this programming thing, and i dont really know much.
Re: HELP WITH LESSON 12!!
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.
Notice how you use variable "b" for two purposes. What you need to do is rename either one.
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!
}
ʕ •ᴥ•ʔ
-
- Posts: 7
- Joined: June 9th, 2012, 12:17 pm
Re: HELP WITH LESSON 12!!
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
all i did was change the b in putpixel to blue in the d3d.h and the d3d.cpp
Re: HELP WITH LESSON 12!!
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"
ʕ •ᴥ•ʔ
-
- Posts: 7
- Joined: June 9th, 2012, 12:17 pm
Re: HELP WITH LESSON 12!!
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