Difference between revisions of "Beginner C++ Game Programming Tutorial 7"
(→Solution Errata) |
(→Solution Errata) |
||
Line 27: | Line 27: | ||
Now the bug in the second problem is something that Chili has mentioned before. It is a mix-up between the = and == operators. Specifically, it is as follows (error on line 64): | Now the bug in the second problem is something that Chili has mentioned before. It is a mix-up between the = and == operators. Specifically, it is as follows (error on line 64): | ||
− | <source lang="cpp" line=" | + | <source lang="cpp" line="3"> |
colliding == | colliding == | ||
OverlapTest( x_fixed0,y_fixed0,x_mobile,y_mobile ) || | OverlapTest( x_fixed0,y_fixed0,x_mobile,y_mobile ) || |
Revision as of 22:43, 12 September 2016
Mr. DeBugger is a real sir.
Contents
Concepts Taught
- Using the Visual Studio debugger
Chili's Dank Meta Nugs
- Don't binge watch the tutorials--space that shit out
- Practice and experiment with C++ on your own initiative
Video Timestamp Index
Coming soon!
Homework
There are three problems to solve in three separate solutions. The solutions are all based on the code used in the tutorial video (the code from the Tutorial 6 homework) Download the zip of the solutions below in the Downloads section.
- Assertion fails! Find the bug! Also, there's another bug hiding if you solve the first one. Try making the boxes collide and see what happens (or what doesn't happen...). Note that I don't talk about this second bug in the solution video. Check out the Solution Errata below for the answer.
- Assertion fails! Find the bug!
- Moving the cursor to the bottom of the screen is bad news bears...
The solution is given in this video.
Solution Errata
Read the below (click Expand) only after attempting the problem yourself.
In the solution video, we see that the bug in the second homework problem is actually the same bug as in the tutorial video. The reason for this is that Chili fucked up and put the bug he intended to go in the second problem into the first problem. So the first problem has two bugs, and the second problem only has the bug from the tutorial.
Now the bug in the second problem is something that Chili has mentioned before. It is a mix-up between the = and == operators. Specifically, it is as follows (error on line 64):
colliding ==
OverlapTest( x_fixed0,y_fixed0,x_mobile,y_mobile ) ||
OverlapTest( x_fixed1,y_fixed1,x_mobile,y_mobile ) ||
OverlapTest( x_fixed2,y_fixed2,x_mobile,y_mobile ) ||
OverlapTest( x_fixed3,y_fixed3,x_mobile,y_mobile );