XNA Game-Themed Programming Assignments Kelvin Sung Computing and Software Systems University of Washington, Bothell Serious Game Winter School, Puerto Vallarta, Mexico, Feb 2010 Idea Given a “Starter Project” with All Graphics and User support Does not work! Students complete the system by implementing the “missing piece” Support Professors who does not know any graphics or games programming! Serious Game Winter School, Puerto Vallarta, Mexico, Feb 2010 Our Approach: Game-Themed Assignment A set of Programming Assignment Modules … Designed to be adopted selectively in existing classes No requirements on knowledge of graphics or gaming 7 assignment modules on well defined CS1/2 topics: For example: 2D Array / BST / Lists etc. Each module includes 2 versions: Game-themed and “traditional” console version Console version is a good reference Based on the same topics, the two versions may be different: e.g.: 2D Array / BST / Lists Serious Game Winter School, Puerto Vallarta, Mexico, Feb 2010 Assignment Module: Contents For Faculty: Summary page: prerequisite + learning outcomes Sample pre and post-tests Sample solution: console / XNA Sample Grading rubric (console / XNA) FAQs XNA Implementation Guide: on Graphics + UI For Students: Description of the assignment (console / XNA) Skeleton starter project (console / XNA) Serious Game Winter School, Puerto Vallarta, Mexico, Feb 2010 All The Assignments XGA ReleaseNote Operator: Console, XNA Starter, XNA Solution Random Numbers & Arrays: Console, XNA Starter, XNA Solution Array of Object References: Console, XNA Starter, XNA Solution 2D Array: Console, XNA Starter, XNA Solution Class Hierarchy: Console, XNA Starter, XNA Solution Linked Lists: Console, XNA Starter, XNA Solution Binary Search Tree: Console, XNA Starter, XNA Solution Serious Game Winter School, Puerto Vallarta, Mexico, Feb 2010 Starter Project Our experience: Students must modify same source code E.g., Operator: Console, XNA Starter, XNA Solution Students are given a well defined API E.g., BST: Console, XNA Starter, XNA Solution Serious Game Winter School, Puerto Vallarta, Mexico, Feb 2010 Example XGAs: Switch, Modulus, Integer Division What Worked Well: Graphical, interactive Forced students to think about things like mod operator, in an open-ended / real-world-ish sort of way What Didn’t Work So Well: Students can do this without integer division (Do real division, then cast to int, then do mod) One can’t really solve this without some understanding of the video game structure – Color.Red, or a clear view of the coordinate system. Serious Game Winter School, Puerto Vallarta, Mexico, Feb 2010 Example XGAs: Binary Search Trees Students implement a BST of chars Add( char c ) Find( char c ) int FindTreeDepth() Clone() -> new, deep copy of the tree void Balance() // balances existing nodes in-place Students do NOT implement: BST also has an in-order traverse method, privately implemented in the base class, so that the video game works, but doesn’t give away answers Serious Game Winter School, Puerto Vallarta, Mexico, Feb 2010 Example XGAs: Binary Search Trees What Worked Well: Graphical, interactive Nicely isolated BST – students really did not have to know about the gaming aspects Could potentially re-use Console based stuff, including unit tests, etc What Didn’t Work So Well: Example being too “academic”? Serious Game Winter School, Puerto Vallarta, Mexico, Feb 2010