[Solved] lesson 12 bug ?
[Solved] lesson 12 bug ?
I've got a huge bug in trying to make an TicTacToe game, from lesson 12.. but i got stuck, everything worked right until the DrawCursor function... i've got the grid, i've got the cursor showing but i can't move it from the middle, it just moves a pixel in right left down and up, but doesn't move from the middle of the grid...
Here's the download for the code :
Here's the download for the code :
Last edited by Raimond on February 6th, 2014, 6:06 pm, edited 1 time in total.
-
- Posts: 432
- Joined: September 26th, 2013, 4:57 pm
- Location: Kentucky
- Contact:
Re: lesson 12 bug ?
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.
Re: lesson 12 bug ?
Pindrought wrote:http://www.planetchili.net/forum/viewtopic.php?f=3&t=2
Read second post in link please.
done
Re: lesson 12 bug ?
i dont have checked the whole code you pasted, but in the beginning i see a space between index and ++?
it should be index++ instead of index ++
It also couls be something else, but then i have to dig further in your code, wich i only could do after my skiing
it should be index++ instead of index ++
It also couls be something else, but then i have to dig further in your code, wich i only could do after my skiing
Re: lesson 12 bug ?
paapcity wrote:i dont have checked the whole code you pasted, but in the beginning i see a space between index and ++?
it should be index++ instead of index ++
It also couls be something else, but then i have to dig further in your code, wich i only could do after my skiing
the space makes no difference in my case
Re: lesson 12 bug ?
it should be
edit: dam computer wasn't letting me post this b4 the edits to include the project had happened
Code: Select all
DrawCursor( baseX + cursorX * squareSize, baseY + cursorY * squareSize );
edit: dam computer wasn't letting me post this b4 the edits to include the project had happened
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
-
- Posts: 432
- Joined: September 26th, 2013, 4:57 pm
- Location: Kentucky
- Contact:
Re: lesson 12 bug ?
Edit: Seriously Luis I was so close, can't believe you beat me by 1 minute! XD
Here's the issue.
Look at your function: Game::ComposeFrame()
This is VERY close to correct. However it isn't. :'(
The issue here, is you are doing cursorX+squareSize and cursorY+squareSize
You should be multiplying those two.
So, change that line to
And Tah'Dah! That shit is like magic.
Here's the issue.
Look at your function: Game::ComposeFrame()
Code: Select all
DrawCursor( baseX + cursorX + squareSize, baseY + cursorY + squareSize );
The issue here, is you are doing cursorX+squareSize and cursorY+squareSize
You should be multiplying those two.
So, change that line to
Code: Select all
DrawCursor( baseX + cursorX * squareSize, baseY + cursorY * squareSize );
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.
Re: lesson 12 bug ?
haha, such sync problems with each other xD, but my edit above says it xD
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Re: lesson 12 bug ?
and actually i beat you by b4 you made your 1st post in this thread xD
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
-
- Posts: 432
- Joined: September 26th, 2013, 4:57 pm
- Location: Kentucky
- Contact:
Re: lesson 12 bug ?
No fair I hadn't read it yetLuisR14 wrote:and actually i beat you by b4 you made your 1st post in this thread xD
Nah, haha good job finding that, I probably wouldn't have seen that if I couldn't have compiled it.
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.