Lesson 04

(Please ignore this - these are notes for myself for the next iteration of this course)

Notes for next time:

  • There was a Random number generator part in one of the PCEs that needs to be removed
  • Provide more of an intro to the GhostLight game
    • Make sure to mention how to run the correct tutorial
  1. Information: GhostLight: Game Overview
    ('Information' means that there are no required work items, but you do need to understand the material presented here)
    Note: There is only one starter project for the GhostLight game; that one starter project contains individual .CS files for each tutorial.  You will need to download that starter project from the Game Overview in order to use it for any of the other projects)
    Some helpful videos:
    1. Running the game: Make sure to right-click on the 'user' project, then select Set As Startup Project
    2. How to get Visual Studio to show you the output window (Debug menu, then Windows, then Output), then select 'Debug' output
    3. You have to "Start Debugging" in order to System.Diagnostics.Trace.WriteLine messages
      (This was my problem in class Wednesday night - I used "Start Without Debugging" and as a result, it didn't show me the messages!)
    4. These were recorded using Visual Studio Express 2013 for the Desktop, but all other versions of VS will have the same functionality.  The names and exact locations may change a bit, but you should be able to find them
  2. Information: GhostFinder: Basic API
    1. This will show you some of the basic aspects of the API for the game .  It does not cover arrays at all.
    2. You are NOT required to watch any of the game videos, although you may find it useful to do so. 
    3. Note that the code samples in the game tutorials use Java instead of C#.  You'll notice that there's a table labeled 'Warning: Language Differences' which will tell you to replace Java's KeyEvent.VK_SPACE with C#'s Keys.Space, for example.  While the C# project correctly uses C#, you will need to fix any code that you copy-and-paste from the tutorial into your program.
    4. While you will use the knowledge you gain from this tutorial in future exercises, there is nothing that you are required to hand in for this tutorial.
      1. In particular, read through the final section which explains the keyboard shortcuts to pause/restart the chain, spawn various balls, etc.  This level of control can help you figure out problems when you're writing code.
  3. Information: Creating and accessing an array
    1. This will explain how to create monsters on-screen and how to move them around by changing the elements of an array. It will also demonstrate how to swap two elements of any array (not just our monster array).
    2. While you will use the knowledge you gain from this tutorial in future exercises, there is nothing that you are required to hand in for this tutorial.
  4. Information: Arrays and loops
    1. This will explain how to change multiple elements in an array, using a loop.  Game wise you'll see how to remove all the monsters that the player's flashlight is shining on.
    2. While you will use the knowledge you gain from this tutorial in future exercises, there is nothing that you are required to hand in for this tutorial.
  5. Exercise: Sum and average (Hand-In)
    1. This will show you how to to do something with each element of a given array, and to calculate averages
    2. You need to complete exercise #1
      1. Do all the work for this exercise by modifying the C# starter project for this tutorial that is linked to on the tutorial page (near the top
      2. In order to hand this in you will need to find the Tutorial_04.cs file and then copy it into the .ZIP folder that you will submit for grading (please make sure that the file is very easy to find - don't bury it in any folders)

 

Feedback / Improvements on exericses:
(Please ignore this - these are notes for myself for the next iteration of this course)

Lesson 04 ICEs were really bumpy.  Students had lots of questions on stuff that was covered in the videos (I think).  Double-check that videos actually covered everything?  Was it that this style of tracing was too new?  Hmmmm................

GET THE TRACE TABLE FROM LESSON 05 ICEs & PULL BACK TO HERE, TOO

PCE IDEA: Cryptogram exercise? two parallel arrays of chars, then shuffle one, then use that (and String.charAt) to transcode some text.  Maybe a theme for these PCEs?

Removed:

  • Arrays: Basics (Sect. 8.1, 8.2)
    VIDEO: Basic Arrays (of Simple Types)
    VIDEO: Arrays & Loops
  • Passing arrays to functions (Sect. 8.7, 8.8) (Hand-In) 
    VIDEO: Arrays as parameters & return values
  • Returning an array from a method  (Hand-In) 
    (http://www.java2s.com/Code/CSharp/Language-Basics/Returnanarray.htm has an interesting example; you should feel free to Google for more info, if you need it)
    VIDEO: Details of returning an array 

Redo Voting:

  1. Warning about the exam / PCE 06
    x1

  2. OOP Basics 
    Same video as #4 (Bg/motivation)?
  3. OOP Encapsulation 
    x1 When you're allowed to call what sort of methods
  4. Object Oriented Programming (OOP): Background / Motivation
    THIS SHOULD BE THE FIRST VIDEO
  5. OOP: (Instance) Methods, Object Allocation Demo
  6. OOP: Instance Variables
  7. OOP: Access control (public/private), getter/setter methods

  8. Overloading
    x2 lots of static in the background

  9. OOP: Constructors

  10. Basic Array of Objects
    x2 Redo with more detail?
  11. Null References Within An Array