I don't know why it isn't working. I have no big experience in programming. I'm at lesson 15. Tried to use debugger, and by calculations all should work fine .
Help please.
Help with Tetris game, can't find the errors.
Help with Tetris game, can't find the errors.
- Attachments
-
- Tetris.zip
- Visual Studio project.
- (8.12 MiB) Downloaded 189 times
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Help with Tetris game, can't find the errors.
first run, while drawing one of the lines or rectangles one the parameters being sent is missing a value. Haven't found it yet will edit when I do.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Help with Tetris game, can't find the errors.
one of the biggest problem is your code is very confusing to follow. I know as far as the compiler is concerned spaces don't matter between variables and operators such as the = or <=, but as far as someone being able to read it and follow along not having the spaces make it hard to debug.
I found a couple of places where you didn't have { } surrounding your for loops.
There is an if control statement that just says if(true) which there isn't a comparison so wouldn't be needed true will never be false.
In debug mode I get errors basically saying PutPixel is trying to draw outside the boundaries of the window, which are at the moment the problem is y < 0 when drawing some of the rectangles.
You also said that you just went through lesson 15, a lesson over struct. I believe you can really use that information and change from int fgx[11][5][5][3] to something a little more readable.
I found a couple of places where you didn't have { } surrounding your for loops.
There is an if control statement that just says if(true) which there isn't a comparison so wouldn't be needed true will never be false.
In debug mode I get errors basically saying PutPixel is trying to draw outside the boundaries of the window, which are at the moment the problem is y < 0 when drawing some of the rectangles.
You also said that you just went through lesson 15, a lesson over struct. I believe you can really use that information and change from int fgx[11][5][5][3] to something a little more readable.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: Help with Tetris game, can't find the errors.
I found several errors in your code some of which albinopapa said. The problem is your code is just too unreadable I would not use multidimensional arrays. I would go with something like a struct.
Computer too slow? Consider running a VM on your toaster.