COMP1400 – Programming for Designers

Class announcements for Programming for Designers

COMP1400 – Programming for Designers random header image

Tut 11 – Source debugger

Posted by on October 5th, 2010 · Lab

I have arranged for Unity 3 to be installed on the CHI Lab Macs. It includes the debugger that I demonstrated in the lecture. We’ll use it to step through some code.

  • Download the GrowFlowers.js script from the lecture.
  • Create a project to run it in. Remember to save the scene.
  • Set Preferences to use MonoDevelop as your editor (instructions)
  • Sync your project.
  • Read the debugger instructions.
  • Open GrowFlowers.js in MonoDevelop.
  • Set breakpoints on the line 9 and 23.
  • Start the debugger with Run > Debug
  • In the new Unity window, open the saved scene and press play.
  • The debugger should return showing line 9 highlighted.
  • Use the Step Over button to step through the code.
  • When you get to the end of the Start method, press the Continue button.
  • The debugger will run for a while and then stop at line 23.
  • Use the Step Over button to step through the code.
  • Watch the values change in the Locals window.
  • When you get to the end of the Update method, press the Continue button.

Try this out with different initial values in the heights array to see what happens.

Change the code to make the flowers shrink, starting with the tallest flower. Try running your code in the debugger to see what it does.

No Comments so far ↓

There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.