Thx for the help Greven. I found my error.. I had decided to use an enum instead of the const int''s for the list of TILECOLORs.. Well in the prototype I had accounted for this alteration, but I did not anywhere else in the code! Have it working perfectly now.
Thanks a lot for the help and for the great tutorial!
Tetris clone in an hour with C++.
Awsome. Definitely article worthy.
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
When you find yourself in the company of a halfling and an ill-tempered Dragon, remember, you do not have to outrun the Dragon...
Hi, i was able to get all the code to compile on VS.NET 2003 (i created a blank win32 project for this) but when I try to run it, nothing happens, no errors, nothing. Has anyone else had this problem???
Not sure what to do...
Not sure what to do...
Well, I don''t have VS.NET but it sounds to me like the program is exiting immediately, if nothing is showing up at all.
This could be caused by a few things. Check your WinMain() function to see if it is correct, and also check TheWindowProc() function.
For instance, if in TheWindowProc() you happen to have:
instead of:
You won''t recieve any errors... and it will exit instantly and you''ll never even see the window created.
Check for something like that.
-Greven
This could be caused by a few things. Check your WinMain() function to see if it is correct, and also check TheWindowProc() function.
For instance, if in TheWindowProc() you happen to have:
//check for escape keyif(wParam=VK_ESCAPE) {DestroyWindow(hWndMain); return(0);//handled message }
instead of:
//check for escape keyif(wParam==VK_ESCAPE) {DestroyWindow(hWndMain); return(0);//handled message }
You won''t recieve any errors... and it will exit instantly and you''ll never even see the window created.
Check for something like that.
-Greven
Wow. If this is the basics of basic game programming, I'm screwed!
No, really. I kinda understand what's going on in the tutorial, but not enough to be confident in creating my own tetris clone without the help of the tutorial.
It isn't that the tut is bad, its just hard for me, personally, to learn from just looking at/typing up someone else's code. It doesn't click for me.
In order for me to learn well, I generally have to tinker. I've done some tinkering with the things I understand here (changing the size of the tiles and such) but I need some guidance as to how this code can be changed and what the changes would do.
I already have some ideas, like I'm guessing that if I changed the numbers [-][-] in the switch (newblock) statement I'd end up with some pretty funky looking block groupss! I also suppose that I could fairly easily ADD groups of blocks to the game so long as I make appropriate changes to the newblock=rand()%[number]; line.
Any other suggestions for tinkering that would help me understand the code better?
Thanks for the tutorial btw. I read that article that said the first step to learning to program was making a tetris clone, to which I responded 'Well, how do I do that?' Now I can find out... eventually.
[edited by - ArtGeek on April 16, 2004 11:06:12 PM]
[edited by - ArtGeek on April 16, 2004 11:41:18 PM]
No, really. I kinda understand what's going on in the tutorial, but not enough to be confident in creating my own tetris clone without the help of the tutorial.
It isn't that the tut is bad, its just hard for me, personally, to learn from just looking at/typing up someone else's code. It doesn't click for me.
In order for me to learn well, I generally have to tinker. I've done some tinkering with the things I understand here (changing the size of the tiles and such) but I need some guidance as to how this code can be changed and what the changes would do.
I already have some ideas, like I'm guessing that if I changed the numbers [-][-] in the switch (newblock) statement I'd end up with some pretty funky looking block groupss! I also suppose that I could fairly easily ADD groups of blocks to the game so long as I make appropriate changes to the newblock=rand()%[number]; line.
Any other suggestions for tinkering that would help me understand the code better?
Thanks for the tutorial btw. I read that article that said the first step to learning to program was making a tetris clone, to which I responded 'Well, how do I do that?' Now I can find out... eventually.
[edited by - ArtGeek on April 16, 2004 11:06:12 PM]
[edited by - ArtGeek on April 16, 2004 11:41:18 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement