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

  • Intro 0:00
  • Introducing the Debugger 0:31
  • Setting up the debugger 1:41
  • Running in debug mode 2:25
  • The call stack 2:45
  • Finding debug windows 3:17
  • Release vs Debug mode: assertions 3:50
  • Autos 4:56
  • Debugging second solution: setting your own breakpoints, stepping over and stepping into 6:38
  • Locals 9:30
  • Step out 10:39
  • Continue 11:33
  • Advice from Chili 12:10
  • Chili's Dank Meta Nugs 12:45
  • Homework 16:35

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