Beginner C++ Game Programming Tutorial 7

From Chilipedia
Jump to: navigation, search

Mr. DeBugger is a real sir.

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.

  1. 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.
  2. Assertion fails! Find the bug!
  3. 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 of Game.cpp):

	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 );

Downloads

See also