Developing Programming Assignments on the XBOX 360 Console

Section II: The XnaAssignmentBase Library
b. Controlling a circle

back to workshop main page


References:

Goals:

Notice:  To work with the XnaAssignmentBase Library, a bare minimum project must include:


BeginTemplateSource: Download and unzip the begin template source folder and you will see two folders: If we try to compile this project, we will get an error message saying something about the fact that the constructor expects some parameters. In this tutorial we will
  1. Fix the compile error by specifying a proper coordinate system during construction.
  2. Show how to include XnaAssignmentBase_PC.dll as a library reference for the project.
  3. Include code to control and draw the circle.
  4. Show how to include the font file in the Content folder.

1. Fixing the Constructor:  During construction, we must include a call to the base class (XnaAssignmentBase) and specify the coordinate values of the lower left corner and the width of the application window. We will define a coordinate system with lower-left corner being the origin (0,0), with the application window being 15 unites wide: If we compile our project now we will get an error complaining about XnaAssignmentBase is not defined. We must include a reference to the dll library.
 
2. Reference to the DLL library:  Now we can compile and run the application. Though, nothing shows up, this is expected because our application is complete empty.
 
3. Draw and control a circle:  Now we can compile and run the application and see the circle. However, the application crashes complaining about cannot locate the Font file.
 
4. Including the font file:  Now finally we can compile and run the application.
 
This document and the related materials are developed with support from Microsoft Research Computer Gaming Initiative under the Computer Gaming Curriculum in Computer Science RFP, Award Number 15871.


Kelvin Sung
Computing and Software Systems
University of Washington, Bothell
ksung@u.washington.edu