<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.autismcollaborative.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Zinsser</id>
		<title>TACWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://www.autismcollaborative.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Zinsser"/>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Special:Contributions/Zinsser"/>
		<updated>2026-05-06T15:07:53Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.4</generator>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=597</id>
		<title>Dev Setup</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=597"/>
				<updated>2009-09-07T20:51:55Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow these steps to run the development build of the game.&lt;br /&gt;
&lt;br /&gt;
==System Requirements==&lt;br /&gt;
&lt;br /&gt;
===Windows XP or Vista===&lt;br /&gt;
&lt;br /&gt;
* Hardware:&lt;br /&gt;
** A graphics card that supports DirectX 9.0c and Shader Model 1.1 or newer.&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&amp;amp;DisplayLang=en DirectX End-User Runtime 9.0c] or newer.&lt;br /&gt;
** [http://www.microsoft.com/express/download/ Microsoft Visual C# 2008 Express Edition] (the full version of Visual Studio 2008 should also work).&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;amp;DisplayLang=en Microsoft .NET Redistributable Version 2.0] (This may have already been installed by MSC#2008Express. If a newer version is already installed, that will likely be sufficient). Windows Vista users should find that this is already installed as part of the OS.)&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=80782277-d584-42d2-8024-893fcd9d3e82&amp;amp;displaylang=en Microsoft XNA Game Studio 3.1].&lt;br /&gt;
** [http://tortoisesvn.net/downloads TortoiseSVN] (other Subversion clients will not work because the build system also uses SubWCRev, a tool included with TortoiseSVN)&lt;br /&gt;
&lt;br /&gt;
===Other Systems===&lt;br /&gt;
&lt;br /&gt;
XNA does not officially support non-Windows systems. See [http://www.mono-project.com/Main_Page Mono] and [http://groups.google.com/group/monoxna MonoXna] for assistance.&lt;br /&gt;
&lt;br /&gt;
==Download the Code==&lt;br /&gt;
&lt;br /&gt;
* Obtain a Subversion username and password from a Subversion Admin ([[User:Belmonte|Matthew Belmonte]]). The username will be used to track your changes to the code repository and the password will be known by all Subversion Admins.&lt;br /&gt;
* From within the Windows Explorer, check out the repository:&lt;br /&gt;
** Create a new directory, called &amp;quot;Autism Collaborative&amp;quot; for example.&lt;br /&gt;
** Right-click (or on a Macintosh running Windows, place two fingers on the trackpad and click) on the folder and select TortsoiseSVN-&amp;gt;Checkout... from the context menu&lt;br /&gt;
** In the URL of repository field, enter http://www.AutismCollaborative.org/autism_collaborative/&lt;br /&gt;
** Click OK&lt;br /&gt;
&lt;br /&gt;
==Run the Game==&lt;br /&gt;
&lt;br /&gt;
New users of Visual Studio or similar IDE (Integrated Development Environment) should check out Microsoft&amp;#039;s [http://msdn.microsoft.com/vstudio/express/beginner/ Online Learning Center].&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
If the code won&amp;#039;t build/run at this point, check out the [[Troubleshooting]] page.&lt;br /&gt;
&lt;br /&gt;
==Start Developing==&lt;br /&gt;
&lt;br /&gt;
Read [[How to Make a Mini-Game]] to get started developing your own addition.&lt;br /&gt;
&lt;br /&gt;
Check out the [[Code Overview]] for an explanation of how the code base works. It may also be helpful to visit the [[Code How To&amp;#039;s]] for explanations of common coding tasks. And don&amp;#039;t forget about the weekly [[Meetings]]!&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=596</id>
		<title>TODO List</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=596"/>
				<updated>2009-09-04T21:12:23Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the communal TODO list. Use it to store tasks that will be done several weeks from now or have no particular dev assigned to them. This is obviously not a complete list, but should contain all of the major tasks that are planned, but are not currently being worked on.&lt;br /&gt;
&lt;br /&gt;
==Tier I (must eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Add the appropriate copyright information (see GNU public license) to each file and a file in the build with the copyright info&lt;br /&gt;
* Make fonts resolution dependent. Right now their physical size is in pixels so their display size changes as resolution changes.&lt;br /&gt;
* Implement some form Jump/Goto in the ScriptManager Lua Interpreter.&lt;br /&gt;
** Change all the tutorials to allow the user to repeat sections until they are ready to progress&lt;br /&gt;
** Implement a &amp;quot;tutorial menu&amp;quot; that allows users to jump to one particular section and then return to the menu. This option should only be available after the tutorial has been played once through.&lt;br /&gt;
&lt;br /&gt;
==Tier II (should eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Load all content in overloads of Microsoft.Xna.Framework.Game.LoadGraphicsContent() and unload them in ...UnloadGraphicsContent()&lt;br /&gt;
&lt;br /&gt;
==Tier III (would be nice to have, but definitely not necessary)==&lt;br /&gt;
 &lt;br /&gt;
* Voice overs for dialog&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=595</id>
		<title>Dev Setup</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=595"/>
				<updated>2009-08-30T15:38:44Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow these steps to run the development build of the game.&lt;br /&gt;
&lt;br /&gt;
==System Requirements==&lt;br /&gt;
&lt;br /&gt;
===Windows XP or Vista===&lt;br /&gt;
&lt;br /&gt;
* Hardware:&lt;br /&gt;
** A graphics card that supports DirectX 9.0c and Shader Model 1.1 or newer.&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&amp;amp;DisplayLang=en DirectX End-User Runtime 9.0c] or newer.&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?familyid=7D70D6ED-1EDD-4852-9883-9A33C0AD8FEE&amp;amp;displaylang=en Microsoft XNA Game Studio 3.0].&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;amp;DisplayLang=en Microsoft .NET Redistributable Version 2.0] (if a newer version is already installed, that will likely be sufficient). Windows Vista users should find that this is already installed as part of the OS.&lt;br /&gt;
&lt;br /&gt;
====Development====&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/express/download/ Microsoft Visual C# 2008 Express Edition] (the full version of Visual Studio 2008 should also work).&lt;br /&gt;
** [http://tortoisesvn.net/downloads TortoiseSVN] (other Subversion clients will not work because the build system also uses SubWCRev, a tool included with TortoiseSVN)&lt;br /&gt;
&lt;br /&gt;
===Other Systems===&lt;br /&gt;
&lt;br /&gt;
XNA does not officially support non-Windows systems. See [http://www.mono-project.com/Main_Page Mono] and [http://groups.google.com/group/monoxna MonoXna] for assistance.&lt;br /&gt;
&lt;br /&gt;
==Download the Code==&lt;br /&gt;
&lt;br /&gt;
* Obtain a Subversion username and password from a Subversion Admin ([[User:Belmonte|Matthew Belmonte]]). The username will be used to track your changes to the code repository and the password will be known by all Subversion Admins.&lt;br /&gt;
* From within the Windows Explorer, check out the repository:&lt;br /&gt;
** Create a new directory, called &amp;quot;Autism Collaborative&amp;quot; for example.&lt;br /&gt;
** Right-click (or on a Macintosh running Windows, place two fingers on the trackpad and click) on the folder and select TortsoiseSVN-&amp;gt;Checkout... from the context menu&lt;br /&gt;
** In the URL of repository field, enter http://www.AutismCollaborative.org/autism_collaborative/&lt;br /&gt;
** Click OK&lt;br /&gt;
&lt;br /&gt;
==Run the Game==&lt;br /&gt;
&lt;br /&gt;
New users of Visual Studio or similar IDE (Integrated Development Environment) should check out Microsoft&amp;#039;s [http://msdn.microsoft.com/vstudio/express/beginner/ Online Learning Center].&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
If the code won&amp;#039;t build/run at this point, check out the [[Troubleshooting]] page.&lt;br /&gt;
&lt;br /&gt;
==Start Developing==&lt;br /&gt;
&lt;br /&gt;
Read [[How to Make a Mini-Game]] to get started developing your own addition.&lt;br /&gt;
&lt;br /&gt;
Check out the [[Code Overview]] for an explanation of how the code base works. It may also be helpful to visit the [[Code How To&amp;#039;s]] for explanations of common coding tasks. And don&amp;#039;t forget about the weekly [[Meetings]]!&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=594</id>
		<title>Dev Setup</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=594"/>
				<updated>2009-08-30T15:29:38Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow these steps to run the development build of the game.&lt;br /&gt;
&lt;br /&gt;
==System Requirements==&lt;br /&gt;
&lt;br /&gt;
===Windows XP or Vista===&lt;br /&gt;
&lt;br /&gt;
* Hardware:&lt;br /&gt;
** A graphics card that supports DirectX 9.0c and Shader Model 1.1 or newer.&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&amp;amp;DisplayLang=en DirectX End-User Runtime 9.0c] or newer.&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;amp;DisplayLang=en Microsoft .NET Redistributable Version 2.0] (if a newer version is already installed, that will likely be sufficient).&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?familyid=7D70D6ED-1EDD-4852-9883-9A33C0AD8FEE&amp;amp;displaylang=en Microsoft XNA Game Studio 3.0].&lt;br /&gt;
&lt;br /&gt;
====Development====&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/express/download/ Microsoft Visual C# 2008 Express Edition] (the full version of Visual Studio 2008 should also work).&lt;br /&gt;
** [http://tortoisesvn.net/downloads TortoiseSVN] (other Subversion clients will not work because the build system also uses SubWCRev, a tool included with TortoiseSVN)&lt;br /&gt;
&lt;br /&gt;
===Other Systems===&lt;br /&gt;
&lt;br /&gt;
XNA does not officially support non-Windows systems. See [http://www.mono-project.com/Main_Page Mono] and [http://groups.google.com/group/monoxna MonoXna] for assistance.&lt;br /&gt;
&lt;br /&gt;
==Download the Code==&lt;br /&gt;
&lt;br /&gt;
* Obtain a Subversion username and password from a Subversion Admin ([[User:Belmonte|Matthew Belmonte]]). The username will be used to track your changes to the code repository and the password will be known by all Subversion Admins.&lt;br /&gt;
* From within the Windows Explorer, check out the repository:&lt;br /&gt;
** Create a new directory, called &amp;quot;Autism Collaborative&amp;quot; for example.&lt;br /&gt;
** Right-click (or on a Macintosh running Windows, place two fingers on the trackpad and click) on the folder and select TortsoiseSVN-&amp;gt;Checkout... from the context menu&lt;br /&gt;
** In the URL of repository field, enter http://www.AutismCollaborative.org/autism_collaborative/&lt;br /&gt;
** Click OK&lt;br /&gt;
&lt;br /&gt;
==Run the Game==&lt;br /&gt;
&lt;br /&gt;
New users of Visual Studio or similar IDE (Integrated Development Environment) should check out Microsoft&amp;#039;s [http://msdn.microsoft.com/vstudio/express/beginner/ Online Learning Center].&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
If the code won&amp;#039;t build/run at this point, check out the [[Troubleshooting]] page.&lt;br /&gt;
&lt;br /&gt;
==Start Developing==&lt;br /&gt;
&lt;br /&gt;
Read [[How to Make a Mini-Game]] to get started developing your own addition.&lt;br /&gt;
&lt;br /&gt;
Check out the [[Code Overview]] for an explanation of how the code base works. It may also be helpful to visit the [[Code How To&amp;#039;s]] for explanations of common coding tasks. And don&amp;#039;t forget about the weekly [[Meetings]]!&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=593</id>
		<title>Dev Setup</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=593"/>
				<updated>2009-08-30T15:24:11Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow these steps to run the development build of the game.&lt;br /&gt;
&lt;br /&gt;
==System Requirements==&lt;br /&gt;
&lt;br /&gt;
===Windows XP or Vista===&lt;br /&gt;
&lt;br /&gt;
* Hardware:&lt;br /&gt;
** A graphics card that supports DirectX 9.0c and Shader Model 1.1 or newer.&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&amp;amp;DisplayLang=en DirectX End-User Runtime 9.0c] or newer.&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;amp;DisplayLang=en Microsoft .NET Redistributable Version 2.0] (if a newer version is already installed, that will likely be sufficient).&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?familyid=7D70D6ED-1EDD-4852-9883-9A33C0AD8FEE&amp;amp;displaylang=en Microsoft XNA Game Studio 3.0].&lt;br /&gt;
&lt;br /&gt;
====Development====&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/express/download/ Microsoft C# Visual Studio]&lt;br /&gt;
** [http://tortoisesvn.net/downloads TortoiseSVN] (other Subversion clients will not work because the build system also uses SubWCRev, a tool included with TortoiseSVN)&lt;br /&gt;
&lt;br /&gt;
===Other Systems===&lt;br /&gt;
&lt;br /&gt;
XNA does not officially support non-Windows systems. See [http://www.mono-project.com/Main_Page Mono] and [http://groups.google.com/group/monoxna MonoXna] for assistance.&lt;br /&gt;
&lt;br /&gt;
==Download the Code==&lt;br /&gt;
&lt;br /&gt;
* Obtain a Subversion username and password from a Subversion Admin ([[User:Belmonte|Matthew Belmonte]]). The username will be used to track your changes to the code repository and the password will be known by all Subversion Admins.&lt;br /&gt;
* From within the Windows Explorer, check out the repository:&lt;br /&gt;
** Create a new directory, called &amp;quot;Autism Collaborative&amp;quot; for example.&lt;br /&gt;
** Right-click (or on a Macintosh running Windows, place two fingers on the trackpad and click) on the folder and select TortsoiseSVN-&amp;gt;Checkout... from the context menu&lt;br /&gt;
** In the URL of repository field, enter http://www.AutismCollaborative.org/autism_collaborative/&lt;br /&gt;
** Click OK&lt;br /&gt;
&lt;br /&gt;
==Run the Game==&lt;br /&gt;
&lt;br /&gt;
New users of Visual Studio or similar IDE (Integrated Development Environment) should check out Microsoft&amp;#039;s [http://msdn.microsoft.com/vstudio/express/beginner/ Online Learning Center].&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
If the code won&amp;#039;t build/run at this point, check out the [[Troubleshooting]] page.&lt;br /&gt;
&lt;br /&gt;
==Start Developing==&lt;br /&gt;
&lt;br /&gt;
Read [[How to Make a Mini-Game]] to get started developing your own addition.&lt;br /&gt;
&lt;br /&gt;
Check out the [[Code Overview]] for an explanation of how the code base works. It may also be helpful to visit the [[Code How To&amp;#039;s]] for explanations of common coding tasks. And don&amp;#039;t forget about the weekly [[Meetings]]!&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Main_Page&amp;diff=592</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Main_Page&amp;diff=592"/>
				<updated>2009-08-30T15:21:56Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Welcome to the Autism Collaborative wiki&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page is used by the developers working on Astropolis, an experimental video game that collects neuroscientific data as people play.  At the Autism Collaborative we want to share both our findings and our processes with the public because we believe that is the most beneficial for everyone.  As such, although this wiki is written primarily for the Astropolis developers, we encourage anyone interested in the project to explore and gain insight into our process for designing and implementing the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Motivation==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Integrative studies of perception, attention, and social cognition in autism&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Although much progress has been made identifying structural and functional profiles in autism, this work has resulted in a multiplicity of hypotheses targeted at particular brain or cognitive subsystems or levels of analysis; our most vexing problem often is not identifying the observational details, but assembling these details into a coherent theory.  The division between social and non-social studies of autism is a case in point.  Competing theories have construed autism variously as an exclusively social deficit in &amp;quot;theory of mind,&amp;quot; an abnormality of attention and executive function with social and non-social consequences, an atypical weakness in &amp;quot;central coherence,&amp;quot; or an enhancement of perceptual function.  Although each of these views seems to capture a piece of the truth, a synthesis of all of them will not be possible as long as they continue to be approached as competing rather than synergistic views, as long as their psychological descriptions remain incompletely connected to neurobiological explanations and to clinical impairments, and as long as individual experiments continue to collect data germane to only one theory in isolation.&lt;br /&gt;
&lt;br /&gt;
==The Strategy==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Embed a suite of psychological experiments within a video game that&amp;#039;s fun to play&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Perhaps the single most important obstacle to integrative studies of autism is the practical limit on the amount of time that a single experimental subject can reasonably be expected to perform before becoming fatigued.  Unfortunately, often the more controlled a stimulus is from the scientist&amp;#039;s point of view, the more repetitive and tedious the experiment can seem from the subject&amp;#039;s point of view.  Behavioural research on autism in recent years has highlighted the importance of motivation, behavioural set, and task instruction in establishing cognitive strategy and determining performance (e.g. Plaisted et al. 1999; Dalton et al. 2005).  In light of these considerations, we propose to embed experimental stimuli in the context of a video game that captures and maintains subjects&amp;#039; interest, transparently collecting behavioural data and synchronising with physiological recording as the subject plays the game.  The practical advantages of such an engaging and ecologically valid format over the usual repetitive blocks of trials are legion.  Indeed, varying levels and demands of attentional shifting and multimodal integration are natural in the context of video game play, and psychophysical measures such as dot motion coherence and embedded figures are easily implemented as, for example, the movement of a star field on a view screen and the detection of an adversary in a cluttered environment.  In addition, the strategic and adversarial nature of a video game carries natural opportunities to explore higher-level cognitive measures such as comprehension of game-related narratives and social attribution to a computer-generated adversary.  The video game format is increasingly being used to acquire simultaneous behavioural and EEG observations in ecologically valid contexts, for example in visuomotor tracking (Smith et al. 1999), air traffic control (Brookings et al. 1996), and military command and control simulations (St John et al. 2002, 2004; Berka et al. 2004).  Recent results in human-computer interaction (von Ahn 2006) also point to the power of the game context to establish and to maintain motivation in tasks that otherwise might not seem engaging, and to teach persons with developmental disorders (Golan &amp;amp; Baron-Cohen 2006).  Also along these lines, the video game format affords subjects more of a chance to become comfortable with the task before entering the laboratory, minimising the potential confound of state anxiety associated with performance of an unfamiliar task in a testing situation.&lt;br /&gt;
&lt;br /&gt;
==Major Sections==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;[[Plot]]&lt;br /&gt;
&lt;br /&gt;
[[Functional specifications]]&lt;br /&gt;
&lt;br /&gt;
[[Meetings]]&lt;br /&gt;
&lt;br /&gt;
[[Dev Setup]]&lt;br /&gt;
&lt;br /&gt;
[[End-user Setup]]&lt;br /&gt;
&lt;br /&gt;
[[Troubleshooting]]&lt;br /&gt;
&lt;br /&gt;
[[Code How To&amp;#039;s]]&lt;br /&gt;
&lt;br /&gt;
[[TODO List]]&lt;br /&gt;
&lt;br /&gt;
[[Concept Art]]&lt;br /&gt;
&lt;br /&gt;
[[Art Assets and Tracking]]&lt;br /&gt;
&lt;br /&gt;
[[System Specifications and Testing]]&amp;lt;/big&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=591</id>
		<title>Dev Setup</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=591"/>
				<updated>2009-08-30T00:25:39Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow these steps to run the development build of the game.&lt;br /&gt;
&lt;br /&gt;
==System Requirements==&lt;br /&gt;
&lt;br /&gt;
===Windows XP or Vista===&lt;br /&gt;
&lt;br /&gt;
* Hardware:&lt;br /&gt;
** A graphics card that supports DirectX 9.0c and Shader Model 1.1 or newer.&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&amp;amp;DisplayLang=en DirectX End-User Runtime 9.0c] or newer.&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;amp;DisplayLang=en Microsoft .NET Redistributable Version 2.0] or [http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&amp;amp;displaylang=en newer].&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?familyid=7D70D6ED-1EDD-4852-9883-9A33C0AD8FEE&amp;amp;displaylang=en Microsoft XNA Game Studio 3.0].&lt;br /&gt;
&lt;br /&gt;
====Development====&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/express/download/ Microsoft C# Visual Studio]&lt;br /&gt;
** [http://tortoisesvn.net/downloads TortoiseSVN] (other Subversion clients will not work because the build system also uses SubWCRev, a tool included with TortoiseSVN)&lt;br /&gt;
&lt;br /&gt;
===Other Systems===&lt;br /&gt;
&lt;br /&gt;
XNA does not officially support non-Windows systems. See [http://www.mono-project.com/Main_Page Mono] and [http://groups.google.com/group/monoxna MonoXna] for assistance.&lt;br /&gt;
&lt;br /&gt;
==Download the Code==&lt;br /&gt;
&lt;br /&gt;
* Obtain a Subversion username and password from a Subversion Admin ([[User:Belmonte|Matthew Belmonte]]). The username will be used to track your changes to the code repository and the password will be known by all Subversion Admins.&lt;br /&gt;
* From within the Windows Explorer, check out the repository:&lt;br /&gt;
** Create a new directory, called &amp;quot;Autism Collaborative&amp;quot; for example.&lt;br /&gt;
** Right-click (or on a Macintosh running Windows, place two fingers on the trackpad and click) on the folder and select TortsoiseSVN-&amp;gt;Checkout... from the context menu&lt;br /&gt;
** In the URL of repository field, enter http://www.AutismCollaborative.org/autism_collaborative/&lt;br /&gt;
** Click OK&lt;br /&gt;
&lt;br /&gt;
==Run the Game==&lt;br /&gt;
&lt;br /&gt;
New users of Visual Studio or similar IDE (Integrated Development Environment) should check out Microsoft&amp;#039;s [http://msdn.microsoft.com/vstudio/express/beginner/ Online Learning Center].&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
If the code won&amp;#039;t build/run at this point, check out the [[Troubleshooting]] page.&lt;br /&gt;
&lt;br /&gt;
==Start Developing==&lt;br /&gt;
&lt;br /&gt;
Read [[How to Make a Mini-Game]] to get started developing your own addition.&lt;br /&gt;
&lt;br /&gt;
Check out the [[Code Overview]] for an explanation of how the code base works. It may also be helpful to visit the [[Code How To&amp;#039;s]] for explanations of common coding tasks. And don&amp;#039;t forget about the weekly [[Meetings]]!&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Troubleshooting&amp;diff=590</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Troubleshooting&amp;diff=590"/>
				<updated>2009-08-29T23:35:15Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains some common problems and solutions that people may run into when starting to use/develop for Astropolis.&lt;br /&gt;
&lt;br /&gt;
==Common Problems for Developers==&lt;br /&gt;
&lt;br /&gt;
===Build Errors===&lt;br /&gt;
&lt;br /&gt;
====Project Util====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Example Error:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Error	1	The command &amp;quot;copy /Y &amp;quot;C:\Users\Arthas\Documents\Astropolis\Game\Util\SVNRes.resx&amp;quot; &amp;quot;C:\Users\Arthas\Documents\Astropolis\Game\Util\libs\temp.resx&amp;quot;&lt;br /&gt;
&amp;quot;SubWCRev.exe&amp;quot; &amp;quot;C:\Users\Arthas\Documents\Astropolis\Game\\&amp;quot; &amp;quot;C:\Users\Arthas\Documents\Astropolis\Game\Util\SVNRes.resx&amp;quot; &amp;quot;C:\Users\Arthas\Documents\Astropolis\Game\Util\SVNRes.resx&amp;quot;&lt;br /&gt;
&amp;quot; exited with code 9009.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Solution&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Ensure that the SubWCRev.exe program (which should be installed alongside the TortoiseSVN clien) is included in your Path Environment Variable.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Troubleshooting&amp;diff=589</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Troubleshooting&amp;diff=589"/>
				<updated>2009-08-29T23:31:46Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains some common problems and solutions that people may run into when starting to use/develop for Astropolis.&lt;br /&gt;
&lt;br /&gt;
==Common Problems for Developers==&lt;br /&gt;
&lt;br /&gt;
===Build Errors===&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=588</id>
		<title>Dev Setup</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=588"/>
				<updated>2009-08-29T22:11:19Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow these steps to run the development build of the game.&lt;br /&gt;
&lt;br /&gt;
==System Requirements==&lt;br /&gt;
&lt;br /&gt;
===Windows XP or Vista===&lt;br /&gt;
&lt;br /&gt;
* Hardware:&lt;br /&gt;
** A graphics card that supports DirectX 9.0c and Shader Model 1.1 or newer.&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&amp;amp;DisplayLang=en DirectX End-User Runtime 9.0c] or newer.&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&amp;amp;DisplayLang=en Microsoft .NET Redistributable Version 2.0] or [http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&amp;amp;displaylang=en newer].&lt;br /&gt;
** [http://www.microsoft.com/downloads/details.aspx?FamilyID=15fb9169-4a25-4dca-bf40-9c497568f102&amp;amp;displaylang=en Microsoft XNA Framework Redistributable 2.0] or [http://www.microsoft.com/downloads/details.aspx?FamilyID=df4af56a-58a7-474c-bfd0-7cf8ed3036a3&amp;amp;DisplayLang=en newer].&lt;br /&gt;
&lt;br /&gt;
====Development====&lt;br /&gt;
&lt;br /&gt;
* Software:&lt;br /&gt;
** [http://www.microsoft.com/express/download/ Microsoft C# Visual Studio]&lt;br /&gt;
** [http://tortoisesvn.net/downloads Tortoise SVN] or other Subversion Client&lt;br /&gt;
&lt;br /&gt;
===Other Systems===&lt;br /&gt;
&lt;br /&gt;
XNA does not officially support non-Windows systems. See [http://www.mono-project.com/Main_Page Mono] and [http://groups.google.com/group/monoxna MonoXna] for assistance.&lt;br /&gt;
&lt;br /&gt;
==Download the Code==&lt;br /&gt;
&lt;br /&gt;
* Obtain a Subversion username and password from a Subversion Admin ([[User:Belmonte|Matthew Belmonte]]). The username will be used to track your changes to the code repository and the password will be known by all Subversion Admins.&lt;br /&gt;
* From within the Windows Explorer, check out the repository:&lt;br /&gt;
** Create a new directory, called &amp;quot;Autism Collaborative&amp;quot; for example.&lt;br /&gt;
** Right-click (or on a Macintosh running Windows, place two fingers on the trackpad and click) on the folder and select TortsoiseSVN-&amp;gt;Checkout... from the context menu&lt;br /&gt;
** In the URL of repository field, enter http://www.AutismCollaborative.org/autism_collaborative/&lt;br /&gt;
** Click OK&lt;br /&gt;
&lt;br /&gt;
==Run the Game==&lt;br /&gt;
&lt;br /&gt;
New users of Visual Studio or similar IDE (Integrated Development Environment) should check out Microsoft&amp;#039;s [http://msdn.microsoft.com/vstudio/express/beginner/ Online Learning Center].&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
&lt;br /&gt;
If the code won&amp;#039;t build/run at this point, check out the [[Troubleshooting]] page.&lt;br /&gt;
&lt;br /&gt;
==Start Developing==&lt;br /&gt;
&lt;br /&gt;
Read [[How to Make a Mini-Game]] to get started developing your own addition.&lt;br /&gt;
&lt;br /&gt;
Check out the [[Code Overview]] for an explanation of how the code base works. It may also be helpful to visit the [[Code How To&amp;#039;s]] for explanations of common coding tasks. And don&amp;#039;t forget about the weekly [[Meetings]]!&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Troubleshooting&amp;diff=587</id>
		<title>Troubleshooting</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Troubleshooting&amp;diff=587"/>
				<updated>2009-08-29T22:08:56Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: New page: This page contains some common problems and solutions that people may run into when starting to use/develop for Astropolis.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains some common problems and solutions that people may run into when starting to use/develop for Astropolis.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=196</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=196"/>
				<updated>2008-05-02T05:43:09Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Create the Installer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
* See the Load a Texture section for naming conventions of texture assets&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT use XNA.Framework.GameTime.ElapsedGameTime&amp;#039;&amp;#039;&amp;#039; because tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Use Images==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine augments XNA&amp;#039;s already great image support by automatically shrinking images based on a global Level Of Detail property. This means you can use it to load a graphic and the engine will automatically shrink its resolution if the Texture Detail settings are changed (via an in-game menu or a script) to Medium or Low (High retains the full resolution). This is more important for the main game since it will need to display a complex 3D scene, and minigames that just use a handful of sprites can essentially ignore this feature.&lt;br /&gt;
&lt;br /&gt;
This is accomplished by discarding the first 0-2 mipmaps of an image. As a result, images without mipmaps (most &amp;quot;common&amp;quot; types like JPEG, PNG, GIF, TIFF) will always be loaded at their max resolution. For that reason, use DDS (or another XNA-supported mipmappable format) for 3D model textures. A DDS plugin for Photoshop is available at [http://developer.nvidia.com/object/nv_texture_tools.html NVidia&amp;#039;s website].&lt;br /&gt;
&lt;br /&gt;
To allow tAC_Engine to determine the appropriate resolution, each texture asset should be tagged with a &amp;quot;_Hi&amp;quot;, &amp;quot;_Med&amp;quot;, or &amp;quot;_Lo&amp;quot; as in &amp;quot;myImage_Hi.dds&amp;quot;. If an image does not contain a detail tag at the end of its filename (before the extension) then the engine assumes it is at High resolution and will scale it down if the LOD property is Medium or lower. Most source images will have the &amp;quot;_Hi&amp;quot; tag, but some (like small objects or icons) may use the &amp;quot;_Med&amp;quot; or even &amp;quot;_Lo&amp;quot; setting to prevent the engine from downsampling them to the point where they are unrecognizable.&lt;br /&gt;
&lt;br /&gt;
===Load a Texture===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT use XNA&amp;#039;s ContentManager&amp;#039;&amp;#039;&amp;#039; to load an asset in code unless you want the asset to ignore tAC_Engine.TextureManager.LOD property. The ContentManager should only be used in engine code when appropriate; games should always use the TextureManager.&lt;br /&gt;
&lt;br /&gt;
But before you can load a texture in code you must add it to the content pipeline:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
&lt;br /&gt;
Once that&amp;#039;s done, you can load it memory with the TextureManager:&lt;br /&gt;
&lt;br /&gt;
 Texture2D myTexture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Do not include the &amp;quot;_Hi&amp;quot; (or &amp;quot;_Med&amp;quot; or &amp;quot;_Lo&amp;quot;) naming convention or the file extension call to TextureManager.Load().&lt;br /&gt;
&lt;br /&gt;
===Display a Static Image===&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a minigame will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
===Display an Animation===&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are currently no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) or mouse accessors (Xna.Framework.Input.MouseState) because tAC_Engine does a lot of caching and logging behind the scenes. Use tAC_Engine.InputState instead.&lt;br /&gt;
&lt;br /&gt;
===Keyboard===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.A))&lt;br /&gt;
 {&lt;br /&gt;
   // The A key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Mouse===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsMouseLeftUp &amp;amp;&amp;amp; InputState.WasMouseLeftDown)&lt;br /&gt;
 {&lt;br /&gt;
  // The mouse was just clicked (clicks are typically registered on the release, not the initial press)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 Vector2 location = InputState.MouseLocation;&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Use the HUD class for any HUD element (like health bars, menu buttons, etc.). Typically, you&amp;#039;ll want to create a class that inherits from Widget2D. See MeteorWidgets.cs for examples.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Publish the Installer==&lt;br /&gt;
&lt;br /&gt;
===Create the Installer===&lt;br /&gt;
&lt;br /&gt;
We use InnoSetup to create the installer. Checkout their website (http://www.jrsoftware.org/isinfo.php) if you need to change the script, but simply publishing the game does not require any adjustment to the installer script.&lt;br /&gt;
&lt;br /&gt;
* Install InnoSetup if necessary&lt;br /&gt;
** Run Autism Collaborative\Utilities\Installer Installer\isetup-5.2.2.exe&lt;br /&gt;
* Compile the game&lt;br /&gt;
** In the second menu bar (immediately below the top menu bar) within Visual Studio, change &amp;quot;Debug&amp;quot; to &amp;quot;ReleasePub&amp;quot; or &amp;quot;ReleaseLab&amp;quot;.  (In the box to the right, leave the default &amp;quot;Mixed Platforms&amp;quot;.)  &lt;br /&gt;
*** ReleasePub is for our releases to the general public. This will usually be the correct configuration.&lt;br /&gt;
*** ReleaseLab is for builds to be used in the lab. This will create the config file to run the game in &amp;quot;lab mode.&amp;quot; The resulting exe file will actually be the same as ReleasePub, but constd.tac will be replaced with conlab.tac.&lt;br /&gt;
*** Debug mode is used while developing, so do not build the game in debug mode when creating the installer.&lt;br /&gt;
*** For the exact effects of the different build configurations on the game flow, unit stats, etc. see the config files in Autism Collaborative\Game\Game\Astropolis\Configs&lt;br /&gt;
** Goto Build-&amp;gt;Build Solution&lt;br /&gt;
* Compile the installer script&lt;br /&gt;
** Open Autism Collaborative\Game\Game\Installer.iss with InnoSetup&lt;br /&gt;
** Goto Build-&amp;gt;Compile&lt;br /&gt;
** Goto Run-&amp;gt;Run&lt;br /&gt;
*** This creates the file Autism Collaborative\Game\Game\Output\tAC_Installer.exe&lt;br /&gt;
&lt;br /&gt;
===Upload the Installer to the Web===&lt;br /&gt;
&lt;br /&gt;
* Get a username/password for autismcollaborative.org from Matthew.&lt;br /&gt;
* Use a secure FTP client to login, such as WinSCP&lt;br /&gt;
** Either download it or run Autism Collaborative\Utilities\WinSCP.exe&lt;br /&gt;
* Login to autismcollaborative.org (port 22)&lt;br /&gt;
* Upload tAC_Installer.exe to your home directory (for example /home/zinsser)&lt;br /&gt;
** Do not overwrite the existing installer (/home/belmonte/autismcollaborative.org/downloads/AstropolisSetup.exe) since that would delete the installer from the website until the new installer finishes uploading (usually over an hour!)&lt;br /&gt;
* Once the upload is complete, enter the command &amp;quot;mv /home/zinsser/tAC_Installer.exe /home/belmonte/autismcollaborative.org/downloads/AstropolisSetup.exe&amp;quot; (you may have to open a terminal first, depending on your SFTP client)&lt;br /&gt;
** In the above command, substitute your username for &amp;quot;zinsser&amp;quot;, but keep &amp;quot;belmonte&amp;quot; as the destination user directory&lt;br /&gt;
** If there is a permissions problem, contact Matthew to make sure your user has permission to the autismcollaborative.org directory!&lt;br /&gt;
&lt;br /&gt;
==Use the ErrorLog==&lt;br /&gt;
&lt;br /&gt;
When the game encounters an Unhandled Exception (like when an end user runs into a bug in our code), useful information is dumped to ErrorLog.txt. The user is encouraged to email that file to us so we can locate the problem they ran into. Although the ErrorLog will tell us what function the program died in, it cannot tell us specifically which line was the culprit (although ErrorLogs created when the game is running in Visual Studio will tell us exactly which line!).&lt;br /&gt;
&lt;br /&gt;
We do, however, have the ability to log any custom information from a MiniGame. This may prove invaluable in debugging based on end-user error reports. All you (the programmer) must do is override the string MiniGame.DebugInfo() function. When ErrorLog.txt is created, it calls that function on the current MiniGame and appends the returned text to the bottom of the file.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=195</id>
		<title>TODO List</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=195"/>
				<updated>2008-04-29T03:48:19Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Tier II (should eventually be implemented) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the communal TODO list. Use it to store tasks that will be done several weeks from now or have no particular dev assigned to them. This is obviously not a complete list, but should contain all of the major tasks that are planned, but are not currently being worked on.&lt;br /&gt;
&lt;br /&gt;
==Tier I (must eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Create a System Settings file (stores things like audio and visual settings)&lt;br /&gt;
* Create user profiles (stores things like name, mental background, difficulty settings)&lt;br /&gt;
* Add the appropriate copyright information (see GNU public license) to each file and a file in the build with the copyright info&lt;br /&gt;
* Make fonts resolution dependent. Right now their physical size is in pixels so their display size changes as resolution changes.&lt;br /&gt;
* Implement some form Jump/Goto in the ScriptManager Lua Interpreter.&lt;br /&gt;
** Change all the tutorials to allow the user to repeat sections until they are ready to progress&lt;br /&gt;
** Implement a &amp;quot;tutorial menu&amp;quot; that allows users to jump to one particular section and then return to the menu. This option should only be available after the tutorial has been played once through.&lt;br /&gt;
* Implement gameflow that allows minigames to return to the main menu and be repeated indefinitely via the practice console.&lt;br /&gt;
&lt;br /&gt;
==Tier II (should eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Do the pause menu correctly&lt;br /&gt;
** It seems that it was implemented to work for Meteor Madness and that&amp;#039;s it. Someone will have to save the state of the mouse cursor and restore it to that previous state on unpause, and not assume whatever is active has no cursor. This should probably be done in a new class (instead of hardcoded into the HUD &amp;#039;&amp;#039;&amp;#039;AND ALSO&amp;#039;&amp;#039;&amp;#039; implemented in GameManager.cs).&lt;br /&gt;
* Load all content in overloads of Microsoft.Xna.Framework.Game.LoadGraphicsContent() and unload them in ...UnloadGraphicsContent()&lt;br /&gt;
* Upgrade to XNA 2.0&lt;br /&gt;
&lt;br /&gt;
==Tier III (would be nice to have, but definitely not necessary)==&lt;br /&gt;
 &lt;br /&gt;
* Voice overs for dialog&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=194</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=194"/>
				<updated>2008-04-17T01:50:58Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Create the Installer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
* See the Load a Texture section for naming conventions of texture assets&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT use XNA.Framework.GameTime.ElapsedGameTime&amp;#039;&amp;#039;&amp;#039; because tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Use Images==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine augments XNA&amp;#039;s already great image support by automatically shrinking images based on a global Level Of Detail property. This means you can use it to load a graphic and the engine will automatically shrink its resolution if the Texture Detail settings are changed (via an in-game menu or a script) to Medium or Low (High retains the full resolution). This is more important for the main game since it will need to display a complex 3D scene, and minigames that just use a handful of sprites can essentially ignore this feature.&lt;br /&gt;
&lt;br /&gt;
This is accomplished by discarding the first 0-2 mipmaps of an image. As a result, images without mipmaps (most &amp;quot;common&amp;quot; types like JPEG, PNG, GIF, TIFF) will always be loaded at their max resolution. For that reason, use DDS (or another XNA-supported mipmappable format) for 3D model textures. A DDS plugin for Photoshop is available at [http://developer.nvidia.com/object/nv_texture_tools.html NVidia&amp;#039;s website].&lt;br /&gt;
&lt;br /&gt;
To allow tAC_Engine to determine the appropriate resolution, each texture asset should be tagged with a &amp;quot;_Hi&amp;quot;, &amp;quot;_Med&amp;quot;, or &amp;quot;_Lo&amp;quot; as in &amp;quot;myImage_Hi.dds&amp;quot;. If an image does not contain a detail tag at the end of its filename (before the extension) then the engine assumes it is at High resolution and will scale it down if the LOD property is Medium or lower. Most source images will have the &amp;quot;_Hi&amp;quot; tag, but some (like small objects or icons) may use the &amp;quot;_Med&amp;quot; or even &amp;quot;_Lo&amp;quot; setting to prevent the engine from downsampling them to the point where they are unrecognizable.&lt;br /&gt;
&lt;br /&gt;
===Load a Texture===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT use XNA&amp;#039;s ContentManager&amp;#039;&amp;#039;&amp;#039; to load an asset in code unless you want the asset to ignore tAC_Engine.TextureManager.LOD property. The ContentManager should only be used in engine code when appropriate; games should always use the TextureManager.&lt;br /&gt;
&lt;br /&gt;
But before you can load a texture in code you must add it to the content pipeline:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
&lt;br /&gt;
Once that&amp;#039;s done, you can load it memory with the TextureManager:&lt;br /&gt;
&lt;br /&gt;
 Texture2D myTexture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Do not include the &amp;quot;_Hi&amp;quot; (or &amp;quot;_Med&amp;quot; or &amp;quot;_Lo&amp;quot;) naming convention or the file extension call to TextureManager.Load().&lt;br /&gt;
&lt;br /&gt;
===Display a Static Image===&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a minigame will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
===Display an Animation===&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are currently no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) or mouse accessors (Xna.Framework.Input.MouseState) because tAC_Engine does a lot of caching and logging behind the scenes. Use tAC_Engine.InputState instead.&lt;br /&gt;
&lt;br /&gt;
===Keyboard===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.A))&lt;br /&gt;
 {&lt;br /&gt;
   // The A key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Mouse===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsMouseLeftUp &amp;amp;&amp;amp; InputState.WasMouseLeftDown)&lt;br /&gt;
 {&lt;br /&gt;
  // The mouse was just clicked (clicks are typically registered on the release, not the initial press)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 Vector2 location = InputState.MouseLocation;&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Use the HUD class for any HUD element (like health bars, menu buttons, etc.). Typically, you&amp;#039;ll want to create a class that inherits from Widget2D. See MeteorWidgets.cs for examples.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Publish the Installer==&lt;br /&gt;
&lt;br /&gt;
===Create the Installer===&lt;br /&gt;
&lt;br /&gt;
We use InnoSetup to create the installer. Checkout their website (http://www.jrsoftware.org/isinfo.php) if you need to change the script, but simply publishing the game does not require any adjustment to the installer script.&lt;br /&gt;
&lt;br /&gt;
* Install InnoSetup if necessary&lt;br /&gt;
** Run Autism Collaborative\Utilities\Installer Installer\isetup-5.2.2.exe&lt;br /&gt;
* Compile the game&lt;br /&gt;
** In the second menu bar (immediately below the top menu bar) within the Visual C# environment, change &amp;quot;Debug&amp;quot; to &amp;quot;ReleasePub&amp;quot; or &amp;quot;ReleaseLab&amp;quot;.  (In the box to the right, leave the default &amp;quot;Mixed Platforms&amp;quot;.)  &lt;br /&gt;
*** ReleasePub is for our releases to the general public. This will usually be the correct configuration.&lt;br /&gt;
*** ReleaseLab is for builds to be used in the lab. This will create the config file to run the game in &amp;quot;lab mode.&amp;quot; The resulting exe file will actually be the same as ReleasePub, but constd.tac will be replaced with conlab.tac.&lt;br /&gt;
*** Debug mode is used while developing, so do not build the game in debug mode when creating the installer.&lt;br /&gt;
** Goto Build-&amp;gt;Build Solution&lt;br /&gt;
* Compile the installer script&lt;br /&gt;
** Open Autism Collaborative\Game\Game\Installer.iss with InnoSetup&lt;br /&gt;
** Goto Build-&amp;gt;Compile&lt;br /&gt;
** Goto Run-&amp;gt;Run&lt;br /&gt;
*** This creates the file Autism Collaborative\Game\Game\Output\tAC_Installer.exe&lt;br /&gt;
&lt;br /&gt;
===Upload the Installer to the Web===&lt;br /&gt;
&lt;br /&gt;
* Get a username/password for autismcollaborative.org from Matthew.&lt;br /&gt;
* Use a secure FTP client to login, such as WinSCP&lt;br /&gt;
** Either download it or run Autism Collaborative\Utilities\WinSCP.exe&lt;br /&gt;
* Login to autismcollaborative.org (port 22)&lt;br /&gt;
* Upload tAC_Installer.exe to your home directory (for example /home/zinsser)&lt;br /&gt;
** Do not overwrite the existing installer (/home/belmonte/autismcollaborative.org/downloads/AstropolisSetup.exe) since that would delete the installer from the website until the new installer finishes uploading (usually over an hour!)&lt;br /&gt;
* Once the upload is complete, enter the command &amp;quot;mv /home/zinsser/tAC_Installer.exe /home/belmonte/autismcollaborative.org/downloads/AstropolisSetup.exe&amp;quot; (you may have to open a terminal first, depending on your SFTP client)&lt;br /&gt;
** In the above command, substitute your username for &amp;quot;zinsser&amp;quot;, but keep &amp;quot;belmonte&amp;quot; as the destination user directory&lt;br /&gt;
** If there is a permissions problem, contact Matthew to make sure your user has permission to the autismcollaborative.org directory!&lt;br /&gt;
&lt;br /&gt;
==Use the ErrorLog==&lt;br /&gt;
&lt;br /&gt;
When the game encounters an Unhandled Exception (like when an end user runs into a bug in our code), useful information is dumped to ErrorLog.txt. The user is encouraged to email that file to us so we can locate the problem they ran into. Although the ErrorLog will tell us what function the program died in, it cannot tell us specifically which line was the culprit (although ErrorLogs created when the game is running in Visual Studio will tell us exactly which line!).&lt;br /&gt;
&lt;br /&gt;
We do, however, have the ability to log any custom information from a MiniGame. This may prove invaluable in debugging based on end-user error reports. All you (the programmer) must do is override the string MiniGame.DebugInfo() function. When ErrorLog.txt is created, it calls that function on the current MiniGame and appends the returned text to the bottom of the file.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=User:Matta&amp;diff=182</id>
		<title>User:Matta</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=User:Matta&amp;diff=182"/>
				<updated>2008-03-11T00:02:15Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: New page: A Developer for the Autism Collaborative&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Developer for the Autism Collaborative&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=User:Orosz&amp;diff=181</id>
		<title>User:Orosz</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=User:Orosz&amp;diff=181"/>
				<updated>2008-03-10T23:55:30Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: New page: A Developer for the Autism Collaborative&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Developer for the Autism Collaborative&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Colony_Mode&amp;diff=180</id>
		<title>Colony Mode</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Colony_Mode&amp;diff=180"/>
				<updated>2008-02-22T19:04:26Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This mode refers to the bulk of the game (or more accurately &amp;quot;toy&amp;quot;) which is spent placing buildings.&lt;br /&gt;
&lt;br /&gt;
==Premise==&lt;br /&gt;
&lt;br /&gt;
In the future, humans have depleted nearly all natural resources from all accessible planet. As they slowly become a nomadic species, they rely more and more on colonies that float through space looking for new planets and life forms. &lt;br /&gt;
&lt;br /&gt;
Play as a colony leader, whose job is to build and manage a city contained within a large spacecraft.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
&lt;br /&gt;
This is technically a toy, so there is no clear objective.  Some players may attempt to make a large city which requires efficient placement of buildings.  Others may strive to build specific structures and will need to first build their target&amp;#039;s dependencies.&lt;br /&gt;
&lt;br /&gt;
==Gameplay==&lt;br /&gt;
&lt;br /&gt;
[[Image:ColonyMode_Mockup.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;As of Feb 2008, this gameplay spec is very old. Stay tuned for an up-to-date version!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main city area is divided into a grid oriented at 45 degrees (to increase visibility).  Buildings and units can occupy any number of whole squares.  Each grid space may only host 1 structure, but may host as many units as necessary.  The game is turn based, but there are multiple turns per second thus giving the game a real-time feel.  Units can only move 1 space per turn and must wait a specific number of turns before moving again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upon starting a new game, the player is presented with an empty city.  Resources are dispersed randomly (and count as structures).  If the player has enough resources, (s)he can select a building and then place it on the map to instantly construct it.  If the building comes with units, they are launched.  A unit has 1 destination and travels along the least-cost path to its objective.  Roads lower the cost of travel.  Once it arrives, a unit remains at its objective for some randomized number of turns and then returns to its home structure.  Citizens travel to work or recreational areas, harvesters travel to resources, transporters travel to industrial complexes, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Certain structures generate resource income upon the return of their unit(s).  This accounts for the majority of the player&amp;#039;s resources.  The one exception is money, which can only be generated by playing the minigames.  All structures cost some amount of money, so minigames are inevitable.  With minimal effort, a minigame will also reward a special building which is stored in a &amp;quot;Rewards&amp;quot; menu until placement in the city.  Some minigames reward more than a structure and money, but these less rare rewards can also be earned through the existence of specific city structures. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each building has construction costs and operational costs measured in units of various resources and utilities. See [[Structures]] and [[Consumables]].  If a structure&amp;#039;s operational costs cannot be met, it shuts down and ceases launching its units.  Buildings with harvester or transporter units will increase the player&amp;#039;s resource stock each time the unit returns.  For example, the Lumber Mill launches a harvester that travels to the nearest forest square and after some time returns to the mill thus increasing the player&amp;#039;s supply of wood.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most structures require certain utilities (see [[Structures]] for the list of utility plants).  A meat-packing plant requires Electricity, for example.  In order to operate, this plant must be within 3 grids of a Power Line or other powered structure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last dependency on structures are its employees.  Each structure requires some number of staff and if the city does not have enough citizens then the each new structure does not operate.  As the population grows, structures become operational on a first-built first-served basis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some structures output products (see [[Consumables]] for a complete list).  Each product requires some number of consumables.  Once these consumables are delivered, the structure makes one product and sends it to the appropriate location as a delivery or transport unit.  The location is determined by the type of product.  Food, for example, goes to shops whereas wheels may go to a car factory.&lt;br /&gt;
&lt;br /&gt;
==User Interface==&lt;br /&gt;
&lt;br /&gt;
The screen is divided into two major sections.  The main area displays the city (with approximately 20x20 tiles visible).  A menu bar sits on the right of the screen, approximately 2 inches wide.  The menu bar contains buttons that are labeled graphically.  When the user hovers over them, the name will appear over the cursor.  The buttons are as follows: Build Structure, Build Line, Build Path, Place Reward, Budget, Sell, and Options.  If a button is clicked, then a submenu pops out to the left of the main menu bar.  This submenu contains a scrollable list of all placeable buildings within the selected category.  Clicking on one of these brings up the building information in the bottom area of the main menu.  With a specific building selected, the cursor is replaced by a transparent image of the building if the user mouses over the main city area.  Clicking on a suitable location places that building in the colony. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When no building is selected in the submenu, the user can click on any placed structure to display its information in the bottom of the main menu.  This information contains a picture of the building, and displays (with words and symbols) the build costs, operational costs, output, and units.&lt;br /&gt;
&lt;br /&gt;
==Scoring==&lt;br /&gt;
&lt;br /&gt;
Since there is no explicit victory, a player&amp;#039;s score is essentially the various metrics such as colony asset value, resources, population (both human and android), approval rating, crime, etc. The player may also consider the colony&amp;#039;s products to be their score, as some of the coolest products are very hard to obtain.&lt;br /&gt;
&lt;br /&gt;
==Under the Hood==&lt;br /&gt;
&lt;br /&gt;
This section outlines the algorithms/systems used in the colony mode. Part of the fun of this game is learning the interactions between all the game&amp;#039;s systems and figuring out how to use them to get the kind of colony the user desires.&lt;br /&gt;
&lt;br /&gt;
===Time===&lt;br /&gt;
&lt;br /&gt;
There are two types of time: &amp;#039;&amp;#039;Game&amp;#039;&amp;#039; and &amp;#039;&amp;#039;Visual&amp;#039;&amp;#039;. Both of them are directly proportional to real time * game speed. Visual time is used to make the colony look like it is going through day and night, and should move at the speed that looks the best. Game time determines how fast the colony&amp;#039;s denizens act. The standard unit is 1 day.&lt;br /&gt;
&lt;br /&gt;
===Pathfinding===&lt;br /&gt;
&lt;br /&gt;
This is probably one of the colony&amp;#039;s biggest technical hurdles. If thousands of units are allowed to wander around all willy-nilly the game may come to a screeching halt. Obviously, there will need to be a sophisticated searching algorithm that the units use (like IDA*) but that will be transparent to the user. &lt;br /&gt;
&lt;br /&gt;
Fortunately, the game can place some constraints on unit movement to both lessen the burden of pathing AND make the placement of transportation buidlings/paths in the game more interesting!&lt;br /&gt;
&lt;br /&gt;
====Paths====&lt;br /&gt;
&lt;br /&gt;
The obvious first constraint: units are only allowed to move on paths placed by user. There may be some exceptions for gathering and/or service units, but they would use the paths to get as close to their destination as possible before moving onto open ground. The standard path is a simple road with sidewalks. Vehicles and pedestrians can use them simultaneously.&lt;br /&gt;
&lt;br /&gt;
====Express Paths====&lt;br /&gt;
&lt;br /&gt;
Just as most &amp;#039;&amp;#039;real&amp;#039;&amp;#039; people wouldn&amp;#039;t be willing to take side-streets for very long distances, the colony&amp;#039;s units will only use the standard roads for a certain distance before deeming the destination &amp;quot;too far&amp;quot; and deciding to go somewhere else (like another colony that&amp;#039;s laid-out better!). Units will use standard roads to get to Express Paths (Freeways or Tubes (like the opening scene from Futurama)) and then when they leave the express paths (at user-placed exits) they will travel up to their willingness-to-travel-on-standard-paths distance.&lt;br /&gt;
&lt;br /&gt;
This helps from a programming standpoint because the game can calculate paths from each express path exit to all of the buildings within some manhattan distance and store that as a graph for units to use when calculating travel routes.&lt;br /&gt;
&lt;br /&gt;
====Hubs====&lt;br /&gt;
&lt;br /&gt;
Public transportation can also help. Units may travel to a station (bus stop, train stop, teleporter?) and then travel from another station to their final destination. Note that using a hub means they will leave their vehicles behind and their willingness-to-travel-on-standard-paths distance may be much less once they leave the hub and must walk the rest of the way.&lt;br /&gt;
&lt;br /&gt;
The coding benefit from hubs is very similar to Express Paths, but may require a unit to remember where it left its vehicle and then get back in it when returning to that hub.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Colony_Mode&amp;diff=179</id>
		<title>Colony Mode</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Colony_Mode&amp;diff=179"/>
				<updated>2008-02-22T18:15:27Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Gameplay */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This mode refers to the bulk of the game (or more accurately &amp;quot;toy&amp;quot;) which is spent placing buildings.&lt;br /&gt;
&lt;br /&gt;
==Premise==&lt;br /&gt;
&lt;br /&gt;
In the future, humans have depleted nearly all natural resources from all accessible planet. As they slowly become a nomadic species, they rely more and more on colonies that float through space looking for new planets and life forms. &lt;br /&gt;
&lt;br /&gt;
Play as a colony leader, whose job is to build and manage a city contained within a large spacecraft.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
&lt;br /&gt;
This is technically a toy, so there is no clear objective.  Some players may attempt to make a large city which requires efficient placement of buildings.  Others may strive to build specific structures and will need to first build their target&amp;#039;s dependencies.&lt;br /&gt;
&lt;br /&gt;
==Gameplay==&lt;br /&gt;
&lt;br /&gt;
[[Image:ColonyMode_Mockup.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;As of Feb 2008, this gameplay spec is very old. Stay tuned for an up-to-date version!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The main city area is divided into a grid oriented at 45 degrees (to increase visibility).  Buildings and units can occupy any number of whole squares.  Each grid space may only host 1 structure, but may host as many units as necessary.  The game is turn based, but there are multiple turns per second thus giving the game a real-time feel.  Units can only move 1 space per turn and must wait a specific number of turns before moving again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Upon starting a new game, the player is presented with an empty city.  Resources are dispersed randomly (and count as structures).  If the player has enough resources, (s)he can select a building and then place it on the map to instantly construct it.  If the building comes with units, they are launched.  A unit has 1 destination and travels along the least-cost path to its objective.  Roads lower the cost of travel.  Once it arrives, a unit remains at its objective for some randomized number of turns and then returns to its home structure.  Citizens travel to work or recreational areas, harvesters travel to resources, transporters travel to industrial complexes, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Certain structures generate resource income upon the return of their unit(s).  This accounts for the majority of the player&amp;#039;s resources.  The one exception is money, which can only be generated by playing the minigames.  All structures cost some amount of money, so minigames are inevitable.  With minimal effort, a minigame will also reward a special building which is stored in a &amp;quot;Rewards&amp;quot; menu until placement in the city.  Some minigames reward more than a structure and money, but these less rare rewards can also be earned through the existence of specific city structures. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Each building has construction costs and operational costs measured in units of various resources and utilities. See [[Structures]] and [[Consumables]].  If a structure&amp;#039;s operational costs cannot be met, it shuts down and ceases launching its units.  Buildings with harvester or transporter units will increase the player&amp;#039;s resource stock each time the unit returns.  For example, the Lumber Mill launches a harvester that travels to the nearest forest square and after some time returns to the mill thus increasing the player&amp;#039;s supply of wood.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Most structures require certain utilities (see [[Structures]] for the list of utility plants).  A meat-packing plant requires Electricity, for example.  In order to operate, this plant must be within 3 grids of a Power Line or other powered structure.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The last dependency on structures are its employees.  Each structure requires some number of staff and if the city does not have enough citizens then the each new structure does not operate.  As the population grows, structures become operational on a first-built first-served basis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some structures output products (see [[Consumables]] for a complete list).  Each product requires some number of consumables.  Once these consumables are delivered, the structure makes one product and sends it to the appropriate location as a delivery or transport unit.  The location is determined by the type of product.  Food, for example, goes to shops whereas wheels may go to a car factory.&lt;br /&gt;
&lt;br /&gt;
==User Interface==&lt;br /&gt;
&lt;br /&gt;
The screen is divided into two major sections.  The main area displays the city (with approximately 20x20 tiles visible).  A menu bar sits on the right of the screen, approximately 2 inches wide.  The menu bar contains buttons that are labeled graphically.  When the user hovers over them, the name will appear over the cursor.  The buttons are as follows: Build Structure, Build Line, Build Path, Place Reward, Budget, Sell, and Options.  If a button is clicked, then a submenu pops out to the left of the main menu bar.  This submenu contains a scrollable list of all placeable buildings within the selected category.  Clicking on one of these brings up the building information in the bottom area of the main menu.  With a specific building selected, the cursor is replaced by a transparent image of the building if the user mouses over the main city area.  Clicking on a suitable location places that building in the colony. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When no building is selected in the submenu, the user can click on any placed structure to display its information in the bottom of the main menu.  This information contains a picture of the building, and displays (with words and symbols) the build costs, operational costs, output, and units.&lt;br /&gt;
&lt;br /&gt;
==Scoring==&lt;br /&gt;
&lt;br /&gt;
Since there is no explicit victory, a player&amp;#039;s score is essentially the various metrics such as colony asset value, resources, population (both human and android), approval rating, crime, etc. The player may also consider the colony&amp;#039;s products to be their score, as some of the coolest products are very hard to obtain.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=177</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=177"/>
				<updated>2008-02-15T17:28:30Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Publish the Installer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
* See the Load a Texture section for naming conventions of texture assets&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT use XNA.Framework.GameTime.ElapsedGameTime&amp;#039;&amp;#039;&amp;#039; because tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Use Images==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine augments XNA&amp;#039;s already great image support by automatically shrinking images based on a global Level Of Detail property. This means you can use it to load a graphic and the engine will automatically shrink its resolution if the Texture Detail settings are changed (via an in-game menu or a script) to Medium or Low (High retains the full resolution). This is more important for the main game since it will need to display a complex 3D scene, and minigames that just use a handful of sprites can essentially ignore this feature.&lt;br /&gt;
&lt;br /&gt;
This is accomplished by discarding the first 0-2 mipmaps of an image. As a result, images without mipmaps (most &amp;quot;common&amp;quot; types like JPEG, PNG, GIF, TIFF) will always be loaded at their max resolution. For that reason, use DDS (or another XNA-supported mipmappable format) for 3D model textures. A DDS plugin for Photoshop is available at [http://developer.nvidia.com/object/nv_texture_tools.html NVidia&amp;#039;s website].&lt;br /&gt;
&lt;br /&gt;
To allow tAC_Engine to determine the appropriate resolution, each texture asset should be tagged with a &amp;quot;_Hi&amp;quot;, &amp;quot;_Med&amp;quot;, or &amp;quot;_Lo&amp;quot; as in &amp;quot;myImage_Hi.dds&amp;quot;. If an image does not contain a detail tag at the end of its filename (before the extension) then the engine assumes it is at High resolution and will scale it down if the LOD property is Medium or lower. Most source images will have the &amp;quot;_Hi&amp;quot; tag, but some (like small objects or icons) may use the &amp;quot;_Med&amp;quot; or even &amp;quot;_Lo&amp;quot; setting to prevent the engine from downsampling them to the point where they are unrecognizable.&lt;br /&gt;
&lt;br /&gt;
===Load a Texture===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT use XNA&amp;#039;s ContentManager&amp;#039;&amp;#039;&amp;#039; to load an asset in code unless you want the asset to ignore tAC_Engine.TextureManager.LOD property. The ContentManager should only be used in engine code when appropriate; games should always use the TextureManager.&lt;br /&gt;
&lt;br /&gt;
But before you can load a texture in code you must add it to the content pipeline:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
&lt;br /&gt;
Once that&amp;#039;s done, you can load it memory with the TextureManager:&lt;br /&gt;
&lt;br /&gt;
 Texture2D myTexture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Do not include the &amp;quot;_Hi&amp;quot; (or &amp;quot;_Med&amp;quot; or &amp;quot;_Lo&amp;quot;) naming convention or the file extension call to TextureManager.Load().&lt;br /&gt;
&lt;br /&gt;
===Display a Static Image===&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a minigame will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
===Display an Animation===&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are currently no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) or mouse accessors (Xna.Framework.Input.MouseState) because tAC_Engine does a lot of caching and logging behind the scenes. Use tAC_Engine.InputState instead.&lt;br /&gt;
&lt;br /&gt;
===Keyboard===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.A))&lt;br /&gt;
 {&lt;br /&gt;
   // The A key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Mouse===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsMouseLeftUp &amp;amp;&amp;amp; InputState.WasMouseLeftDown)&lt;br /&gt;
 {&lt;br /&gt;
  // The mouse was just clicked (clicks are typically registered on the release, not the initial press)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 Vector2 location = InputState.MouseLocation;&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Use the HUD class for any HUD element (like health bars, menu buttons, etc.). Typically, you&amp;#039;ll want to create a class that inherits from Widget2D. See MeteorWidgets.cs for examples.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Publish the Installer==&lt;br /&gt;
&lt;br /&gt;
===Create the Installer===&lt;br /&gt;
&lt;br /&gt;
We use InnoSetup to create the installer. Checkout their website (http://www.jrsoftware.org/isinfo.php) if you need to change the script, but simply publishing the game does not require any adjustment to the installer script.&lt;br /&gt;
&lt;br /&gt;
* Install InnoSetup if necessary&lt;br /&gt;
** Run Autism Collaborative\Utilities\Installer Installer\isetup-5.2.2.exe&lt;br /&gt;
* Compile the installer script&lt;br /&gt;
** Open Autism Collaborative\Game\Game\Installer.iss with InnoSetup&lt;br /&gt;
** Goto Build-&amp;gt;Compile&lt;br /&gt;
** Goto Run-&amp;gt;Run&lt;br /&gt;
*** This creates the file Autism Collaborative\Game\Game\Output\tAC_Installer.exe&lt;br /&gt;
&lt;br /&gt;
===Upload the Installer to the Web===&lt;br /&gt;
&lt;br /&gt;
* Get a username/password for autismcollaborative.org from Matthew.&lt;br /&gt;
* Use a secure FTP client to login, such as WinSCP&lt;br /&gt;
** Either download it or run Autism Collaborative\Utilities\WinSCP.exe&lt;br /&gt;
* Login to autismcollaborative.org (port 22)&lt;br /&gt;
* Upload tAC_Installer.exe to your home directory (for example /home/zinsser)&lt;br /&gt;
** Do not overwrite the existing installer (/home/belmonte/autismcollaborative.org/downloads/AstropolisSetup.exe) since that would delete the installer from the website until the new installer finishes uploading (usually over an hour!)&lt;br /&gt;
* Once the upload is complete, enter the command &amp;quot;mv /home/zinsser/tAC_Installer.exe /home/belmonte/autismcollaborative.org/downloads/AstropolisSetup.exe&amp;quot; (you may have to open a terminal first, depending on your SFTP client)&lt;br /&gt;
** In the above command, substitute your username for &amp;quot;zinsser&amp;quot;, but keep &amp;quot;belmonte&amp;quot; as the destination user directory&lt;br /&gt;
** If there is a permissions problem, contact Matthew to make sure your user has permission to the autismcollaborative.org directory!&lt;br /&gt;
&lt;br /&gt;
==Use the ErrorLog==&lt;br /&gt;
&lt;br /&gt;
When the game encounters an Unhandled Exception (like when an end user runs into a bug in our code), useful information is dumped to ErrorLog.txt. The user is encouraged to email that file to us so we can locate the problem they ran into. Although the ErrorLog will tell us what function the program died in, it cannot tell us specifically which line was the culprit (although ErrorLogs created when the game is running in Visual Studio will tell us exactly which line!).&lt;br /&gt;
&lt;br /&gt;
We do, however, have the ability to log any custom information from a MiniGame. This may prove invaluable in debugging based on end-user error reports. All you (the programmer) must do is override the string MiniGame.DebugInfo() function. When ErrorLog.txt is created, it calls that function on the current MiniGame and appends the returned text to the bottom of the file.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=176</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=176"/>
				<updated>2008-02-13T21:08:31Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
* See the Load a Texture section for naming conventions of texture assets&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT use XNA.Framework.GameTime.ElapsedGameTime&amp;#039;&amp;#039;&amp;#039; because tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Use Images==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine augments XNA&amp;#039;s already great image support by automatically shrinking images based on a global Level Of Detail property. This means you can use it to load a graphic and the engine will automatically shrink its resolution if the Texture Detail settings are changed (via an in-game menu or a script) to Medium or Low (High retains the full resolution). This is more important for the main game since it will need to display a complex 3D scene, and minigames that just use a handful of sprites can essentially ignore this feature.&lt;br /&gt;
&lt;br /&gt;
This is accomplished by discarding the first 0-2 mipmaps of an image. As a result, images without mipmaps (most &amp;quot;common&amp;quot; types like JPEG, PNG, GIF, TIFF) will always be loaded at their max resolution. For that reason, use DDS (or another XNA-supported mipmappable format) for 3D model textures. A DDS plugin for Photoshop is available at [http://developer.nvidia.com/object/nv_texture_tools.html NVidia&amp;#039;s website].&lt;br /&gt;
&lt;br /&gt;
To allow tAC_Engine to determine the appropriate resolution, each texture asset should be tagged with a &amp;quot;_Hi&amp;quot;, &amp;quot;_Med&amp;quot;, or &amp;quot;_Lo&amp;quot; as in &amp;quot;myImage_Hi.dds&amp;quot;. If an image does not contain a detail tag at the end of its filename (before the extension) then the engine assumes it is at High resolution and will scale it down if the LOD property is Medium or lower. Most source images will have the &amp;quot;_Hi&amp;quot; tag, but some (like small objects or icons) may use the &amp;quot;_Med&amp;quot; or even &amp;quot;_Lo&amp;quot; setting to prevent the engine from downsampling them to the point where they are unrecognizable.&lt;br /&gt;
&lt;br /&gt;
===Load a Texture===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT use XNA&amp;#039;s ContentManager&amp;#039;&amp;#039;&amp;#039; to load an asset in code unless you want the asset to ignore tAC_Engine.TextureManager.LOD property. The ContentManager should only be used in engine code when appropriate; games should always use the TextureManager.&lt;br /&gt;
&lt;br /&gt;
But before you can load a texture in code you must add it to the content pipeline:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
&lt;br /&gt;
Once that&amp;#039;s done, you can load it memory with the TextureManager:&lt;br /&gt;
&lt;br /&gt;
 Texture2D myTexture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Do not include the &amp;quot;_Hi&amp;quot; (or &amp;quot;_Med&amp;quot; or &amp;quot;_Lo&amp;quot;) naming convention or the file extension call to TextureManager.Load().&lt;br /&gt;
&lt;br /&gt;
===Display a Static Image===&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a minigame will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
===Display an Animation===&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are currently no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) or mouse accessors (Xna.Framework.Input.MouseState) because tAC_Engine does a lot of caching and logging behind the scenes. Use tAC_Engine.InputState instead.&lt;br /&gt;
&lt;br /&gt;
===Keyboard===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.A))&lt;br /&gt;
 {&lt;br /&gt;
   // The A key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Mouse===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsMouseLeftUp &amp;amp;&amp;amp; InputState.WasMouseLeftDown)&lt;br /&gt;
 {&lt;br /&gt;
  // The mouse was just clicked (clicks are typically registered on the release, not the initial press)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 Vector2 location = InputState.MouseLocation;&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Use the HUD class for any HUD element (like health bars, menu buttons, etc.). Typically, you&amp;#039;ll want to create a class that inherits from Widget2D. See MeteorWidgets.cs for examples.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Publish the Installer==&lt;br /&gt;
&lt;br /&gt;
===Create the Installer===&lt;br /&gt;
&lt;br /&gt;
We use InnoSetup to create the installer. Checkout their website (http://www.jrsoftware.org/isinfo.php) if you need to change the script, but simply publishing the game does not require any adjustment to the installer script.&lt;br /&gt;
&lt;br /&gt;
* Install InnoSetup if necessary&lt;br /&gt;
** Run Autism Collaborative\Utilities\Installer Installer\isetup-5.2.2.exe&lt;br /&gt;
* Compile the installer script&lt;br /&gt;
** Open Autism Collaborative\Game\Game\Installer.iss with InnoSetup&lt;br /&gt;
** Goto Build-&amp;gt;Compile&lt;br /&gt;
** Goto Run-&amp;gt;Run&lt;br /&gt;
*** This creates the file Autism Collaborative\Game\Game\Output\tAC_Installer.exe&lt;br /&gt;
&lt;br /&gt;
===Upload the Installer to the Web===&lt;br /&gt;
&lt;br /&gt;
* Get a username/password for autismcollaborative.org from Matthew.&lt;br /&gt;
* Use a secure FTP client to login, such as WinSCP&lt;br /&gt;
** Either download it or run Autism Collaborative\Utilities\WinSCP.exe&lt;br /&gt;
* Login to autismcollaborative.org (port 22)&lt;br /&gt;
* Upload tAC_Installer.exe to your home directory (for example \home\zinsser)&lt;br /&gt;
** Do not overwrite the existing installer (\home\belmonte\autismcollaborative.org\downloads\AstropolisSetup.exe) since that would delete the installer from the website until the new installer finishes uploading (usually over an hour!)&lt;br /&gt;
* Once the upload is complete, enter the command &amp;quot;mv \home\zinsser\tAC_Installer.exe \home\belmonte\autismcollaborative.org\downloads\AstropolisSetup.exe&amp;quot; (you may have to open a terminal first, depending on your SFTP client)&lt;br /&gt;
** In the above command, substitute your username for &amp;quot;zinsser&amp;quot;, but keep &amp;quot;belmonte&amp;quot; as the destination user directory&lt;br /&gt;
** If there is a permissions problem, contact Matthew to make sure your user has permission to the autismcollaborative.org directory!&lt;br /&gt;
&lt;br /&gt;
==Use the ErrorLog==&lt;br /&gt;
&lt;br /&gt;
When the game encounters an Unhandled Exception (like when an end user runs into a bug in our code), useful information is dumped to ErrorLog.txt. The user is encouraged to email that file to us so we can locate the problem they ran into. Although the ErrorLog will tell us what function the program died in, it cannot tell us specifically which line was the culprit (although ErrorLogs created when the game is running in Visual Studio will tell us exactly which line!).&lt;br /&gt;
&lt;br /&gt;
We do, however, have the ability to log any custom information from a MiniGame. This may prove invaluable in debugging based on end-user error reports. All you (the programmer) must do is override the string MiniGame.DebugInfo() function. When ErrorLog.txt is created, it calls that function on the current MiniGame and appends the returned text to the bottom of the file.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=175</id>
		<title>TODO List</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=175"/>
				<updated>2008-02-13T14:25:45Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Tier I (must eventually be implemented) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the communal TODO list. Use it to store tasks that will be done several weeks from now or have no particular dev assigned to them. This is obviously not a complete list, but should contain all of the major tasks that are planned, but are not currently being worked on.&lt;br /&gt;
&lt;br /&gt;
==Tier I (must eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Create a System Settings file (stores things like audio and visual settings)&lt;br /&gt;
* Create user profiles (stores things like name, mental background, difficulty settings)&lt;br /&gt;
* Add the appropriate copyright information (see GNU public license) to each file and a file in the build with the copyright info&lt;br /&gt;
* Make fonts resolution dependent. Right now their physical size is in pixels so their display size changes as resolution changes.&lt;br /&gt;
* Implement some form Jump/Goto in the ScriptManager Lua Interpreter.&lt;br /&gt;
** Change all the tutorials to allow the user to repeat sections until they are ready to progress&lt;br /&gt;
** Implement a &amp;quot;tutorial menu&amp;quot; that allows users to jump to one particular section and then return to the menu. This option should only be available after the tutorial has been played once through.&lt;br /&gt;
* Implement gameflow that allows minigames to return to the main menu and be repeated indefinitely via the practice console.&lt;br /&gt;
&lt;br /&gt;
==Tier II (should eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Load all content in overloads of Microsoft.Xna.Framework.Game.LoadGraphicsContent() and unload them in ...UnloadGraphicsContent()&lt;br /&gt;
* Upgrade to XNA 2.0&lt;br /&gt;
&lt;br /&gt;
==Tier III (would be nice to have, but definitely not necessary)==&lt;br /&gt;
 &lt;br /&gt;
* Voice overs for dialog&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=174</id>
		<title>TODO List</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=174"/>
				<updated>2008-02-11T19:35:37Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the communal TODO list. Use it to store tasks that will be done several weeks from now or have no particular dev assigned to them. This is obviously not a complete list, but should contain all of the major tasks that are planned, but are not currently being worked on.&lt;br /&gt;
&lt;br /&gt;
==Tier I (must eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Create a System Settings file (stores things like audio and visual settings)&lt;br /&gt;
* Create user profiles (stores things like name, mental background, difficulty settings)&lt;br /&gt;
* Add the appropriate copyright information (see GNU public license) to each file and a file in the build with the copyright info&lt;br /&gt;
* Make fonts resolution dependent. Right now their physical size is in pixels so their display size changes as resolution changes.&lt;br /&gt;
&lt;br /&gt;
==Tier II (should eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Load all content in overloads of Microsoft.Xna.Framework.Game.LoadGraphicsContent() and unload them in ...UnloadGraphicsContent()&lt;br /&gt;
* Upgrade to XNA 2.0&lt;br /&gt;
&lt;br /&gt;
==Tier III (would be nice to have, but definitely not necessary)==&lt;br /&gt;
 &lt;br /&gt;
* Voice overs for dialog&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=173</id>
		<title>TODO List</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=173"/>
				<updated>2008-02-11T19:34:29Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Tier II (should eventually be implemented) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the communal TODO list. Use it to store tasks that will be done several weeks from now or have no particular dev assigned to them. This is obviously not a complete list, but should contain all of the major tasks that are planned, but are not currently being worked on.&lt;br /&gt;
&lt;br /&gt;
==Tier I (must eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Create a System Settings file (stores things like audio and visual settings)&lt;br /&gt;
* Create user profiles (stores things like name, mental background, difficulty settings)&lt;br /&gt;
* Add the appropriate copyright information (see GNU public license) to each file and a file in the build with the copyright info&lt;br /&gt;
&lt;br /&gt;
==Tier II (should eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Load all content in overloads of Microsoft.Xna.Framework.Game.LoadGraphicsContent() and unload them in ...UnloadGraphicsContent()&lt;br /&gt;
* Upgrade to XNA 2.0&lt;br /&gt;
* Make fonts resolution dependent. Right now their physical size is in pixels so their display size changes as resolution changes.&lt;br /&gt;
&lt;br /&gt;
==Tier III (would be nice to have, but definitely not necessary)==&lt;br /&gt;
 &lt;br /&gt;
* Voice overs for dialog&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=172</id>
		<title>TODO List</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=172"/>
				<updated>2008-02-11T15:38:49Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Tier III (would be nice to have, but definitely not necessary) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the communal TODO list. Use it to store tasks that will be done several weeks from now or have no particular dev assigned to them. This is obviously not a complete list, but should contain all of the major tasks that are planned, but are not currently being worked on.&lt;br /&gt;
&lt;br /&gt;
==Tier I (must eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Create a System Settings file (stores things like audio and visual settings)&lt;br /&gt;
* Create user profiles (stores things like name, mental background, difficulty settings)&lt;br /&gt;
* Add the appropriate copyright information (see GNU public license) to each file and a file in the build with the copyright info&lt;br /&gt;
&lt;br /&gt;
==Tier II (should eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Load all content in overloads of Microsoft.Xna.Framework.Game.LoadGraphicsContent() and unload them in ...UnloadGraphicsContent()&lt;br /&gt;
&lt;br /&gt;
==Tier III (would be nice to have, but definitely not necessary)==&lt;br /&gt;
 &lt;br /&gt;
* Voice overs for dialog&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=171</id>
		<title>TODO List</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=171"/>
				<updated>2008-02-11T15:38:12Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the communal TODO list. Use it to store tasks that will be done several weeks from now or have no particular dev assigned to them. This is obviously not a complete list, but should contain all of the major tasks that are planned, but are not currently being worked on.&lt;br /&gt;
&lt;br /&gt;
==Tier I (must eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Create a System Settings file (stores things like audio and visual settings)&lt;br /&gt;
* Create user profiles (stores things like name, mental background, difficulty settings)&lt;br /&gt;
* Add the appropriate copyright information (see GNU public license) to each file and a file in the build with the copyright info&lt;br /&gt;
&lt;br /&gt;
==Tier II (should eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Load all content in overloads of Microsoft.Xna.Framework.Game.LoadGraphicsContent() and unload them in ...UnloadGraphicsContent()&lt;br /&gt;
&lt;br /&gt;
==Tier III (would be nice to have, but definitely not necessary)==&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=170</id>
		<title>TODO List</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=TODO_List&amp;diff=170"/>
				<updated>2008-02-11T15:36:22Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: New page: This is the communal TODO list. Use it to store tasks that will be done several weeks from now or have no particular dev assigned to them. This is obviously not a complete list, but should...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the communal TODO list. Use it to store tasks that will be done several weeks from now or have no particular dev assigned to them. This is obviously not a complete list, but should contain all of the major tasks that are planned.&lt;br /&gt;
&lt;br /&gt;
==Tier I (must eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Create a System Settings file (stores things like audio and visual settings)&lt;br /&gt;
* Create user profiles (stores things like name, mental background, difficulty settings)&lt;br /&gt;
* Add the appropriate copyright information (see GNU public license) to each file and a file in the build with the copyright info&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Tier II (should eventually be implemented)==&lt;br /&gt;
&lt;br /&gt;
* Load all content in overloads of Microsoft.Xna.Framework.Game.LoadGraphicsContent() and unload them in ...UnloadGraphicsContent()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Tier III (would be nice to have, but definitely not necessary)==&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Main_Page&amp;diff=169</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Main_Page&amp;diff=169"/>
				<updated>2008-02-11T15:25:25Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Welcome to the Autism Game wiki&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page is used by the developers working on Astropolis, a video game that collects scientific research. Here at the Autism Collaborative, we want to share both our findings and our processes with the public because we believe that is the most beneficial for everyone. As such, this wiki is a tool used by the Astropolis developers, but we encourage anyone interested in the project to explore and gain insight into our process for making the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Motivation==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Integrative studies of perception, attention, and social cognition in autism&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Although much progress has been made identifying structural and functional profiles in autism, this work has resulted in a multiplicity of hypotheses targeted at particular brain or cognitive subsystems or levels of analysis; our most vexing problem often is not identifying the observational details, but assembling these details into a coherent theory.  The division between social and non-social studies of autism is a case in point.  Competing theories have construed autism variously as an exclusively social deficit in &amp;quot;theory of mind,&amp;quot; an abnormality of attention and executive function with social and non-social consequences, an atypical weakness in &amp;quot;central coherence,&amp;quot; or an enhancement of perceptual function.  Although each of these views seems to capture a piece of the truth, a synthesis of all of them will not be possible as long as they continue to be approached as competing rather than synergistic views, as long as their psychological descriptions remain incompletely connected to neurobiological explanations and to clinical impairments, and as long as individual experiments continue to collect data germane to only one theory in isolation.&lt;br /&gt;
&lt;br /&gt;
==The Strategy==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Embed a suite of psychological experiments within a video game that&amp;#039;s fun to play&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Perhaps the single most important obstacle to integrative studies of autism is the practical limit on the amount of time that a single experimental subject can reasonably be expected to perform before becoming fatigued.  Unfortunately, often the more controlled a stimulus is from the scientist&amp;#039;s point of view, the more repetitive and tedious the experiment can seem from the subject&amp;#039;s point of view.  Behavioural research on autism in recent years has highlighted the importance of motivation, behavioural set, and task instruction in establishing cognitive strategy and determining performance (e.g. Plaisted et al. 1999; Dalton et al. 2005).  In light of these considerations, we propose to embed experimental stimuli in the context of a video game that captures and maintains subjects&amp;#039; interest, transparently collecting behavioural data and synchronising with physiological recording as the subject plays the game.  The practical advantages of such an engaging and ecologically valid format over the usual repetitive blocks of trials are legion.  Indeed, varying levels and demands of attentional shifting and multimodal integration are natural in the context of video game play, and psychophysical measures such as dot motion coherence and embedded figures are easily implemented as, for example, the movement of a star field on a view screen and the detection of an adversary in a cluttered environment.  In addition, the strategic and adversarial nature of a video game carries natural opportunities to explore higher-level cognitive measures such as comprehension of game-related narratives and social attribution to a computer-generated adversary.  The video game format is increasingly being used to acquire simultaneous behavioural and EEG observations in ecologically valid contexts, for example in visuomotor tracking (Smith et al. 1999), air traffic control (Brookings et al. 1996), and military command and control simulations (St John et al. 2002, 2004; Berka et al. 2004).  Recent results in human-computer interaction (von Ahn 2006) also point to the power of the game context to establish and to maintain motivation in tasks that otherwise might not seem engaging, and to teach persons with developmental disorders (Golan &amp;amp; Baron-Cohen 2006).  Also along these lines, the video game format affords subjects more of a chance to become comfortable with the task before entering the laboratory, minimising the potential confound of state anxiety associated with performance of an unfamiliar task in a testing situation.&lt;br /&gt;
&lt;br /&gt;
==Major Sections==&lt;br /&gt;
&lt;br /&gt;
[[Plot]]&lt;br /&gt;
&lt;br /&gt;
[[Functional specifications]]&lt;br /&gt;
&lt;br /&gt;
[[Meetings]]&lt;br /&gt;
&lt;br /&gt;
[[Dev Setup]]&lt;br /&gt;
&lt;br /&gt;
[[Code How To&amp;#039;s]]&lt;br /&gt;
&lt;br /&gt;
[[TODO List]]&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=168</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=168"/>
				<updated>2008-02-08T02:29:34Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Create the Installer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
* See the Load a Texture section for naming conventions of texture assets&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT use XNA.Framework.GameTime.ElapsedGameTime&amp;#039;&amp;#039;&amp;#039; because tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Use Images==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine augments XNA&amp;#039;s already great image support by automatically shrinking images based on a global Level Of Detail property. This means you can use it to load a graphic and the engine will automatically shrink its resolution if the Texture Detail settings are changed (via an in-game menu or a script) to Medium or Low (High retains the full resolution). This is more important for the main game since it will need to display a complex 3D scene, and minigames that just use a handful of sprites can essentially ignore this feature.&lt;br /&gt;
&lt;br /&gt;
This is accomplished by discarding the first 0-2 mipmaps of an image. As a result, images without mipmaps (most &amp;quot;common&amp;quot; types like JPEG, PNG, GIF, TIFF) will always be loaded at their max resolution. For that reason, use DDS (or another XNA-supported mipmappable format) for 3D model textures. A DDS plugin for Photoshop is available at [http://developer.nvidia.com/object/nv_texture_tools.html NVidia&amp;#039;s website].&lt;br /&gt;
&lt;br /&gt;
To allow tAC_Engine to determine the appropriate resolution, each texture asset should be tagged with a &amp;quot;_Hi&amp;quot;, &amp;quot;_Med&amp;quot;, or &amp;quot;_Lo&amp;quot; as in &amp;quot;myImage_Hi.dds&amp;quot;. If an image does not contain a detail tag at the end of its filename (before the extension) then the engine assumes it is at High resolution and will scale it down if the LOD property is Medium or lower. Most source images will have the &amp;quot;_Hi&amp;quot; tag, but some (like small objects or icons) may use the &amp;quot;_Med&amp;quot; or even &amp;quot;_Lo&amp;quot; setting to prevent the engine from downsampling them to the point where they are unrecognizable.&lt;br /&gt;
&lt;br /&gt;
===Load a Texture===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT use XNA&amp;#039;s ContentManager&amp;#039;&amp;#039;&amp;#039; to load an asset in code unless you want the asset to ignore tAC_Engine.TextureManager.LOD property. The ContentManager should only be used in engine code when appropriate; games should always use the TextureManager.&lt;br /&gt;
&lt;br /&gt;
But before you can load a texture in code you must add it to the content pipeline:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
&lt;br /&gt;
Once that&amp;#039;s done, you can load it memory with the TextureManager:&lt;br /&gt;
&lt;br /&gt;
 Texture2D myTexture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Do not include the &amp;quot;_Hi&amp;quot; (or &amp;quot;_Med&amp;quot; or &amp;quot;_Lo&amp;quot;) naming convention or the file extension call to TextureManager.Load().&lt;br /&gt;
&lt;br /&gt;
===Display a Static Image===&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a minigame will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
===Display an Animation===&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are currently no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) or mouse accessors (Xna.Framework.Input.MouseState) because tAC_Engine does a lot of caching and logging behind the scenes. Use tAC_Engine.InputState instead.&lt;br /&gt;
&lt;br /&gt;
===Keyboard===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.A))&lt;br /&gt;
 {&lt;br /&gt;
   // The A key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Mouse===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsMouseLeftUp &amp;amp;&amp;amp; InputState.WasMouseLeftDown)&lt;br /&gt;
 {&lt;br /&gt;
  // The mouse was just clicked (clicks are typically registered on the release, not the initial press)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 Vector2 location = InputState.MouseLocation;&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Use the HUD class for any HUD element (like health bars, menu buttons, etc.). Typically, you&amp;#039;ll want to create a class that inherits from Widget2D. See MeteorWidgets.cs for examples.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Publish the Installer==&lt;br /&gt;
&lt;br /&gt;
===Create the Installer===&lt;br /&gt;
&lt;br /&gt;
We use InnoSetup to create the installer. Checkout their website (http://www.jrsoftware.org/isinfo.php) if you need to change the script, but simply publishing the game does not require any adjustment to the installer script.&lt;br /&gt;
&lt;br /&gt;
* Install InnoSetup if necessary&lt;br /&gt;
** Run Autism Collaborative\Utilities\Installer Installer\isetup-5.2.2.exe&lt;br /&gt;
* Compile the installer script&lt;br /&gt;
** Open Autism Collaborative\Game\Game\Installer.iss with InnoSetup&lt;br /&gt;
** Goto Build-&amp;gt;Compile&lt;br /&gt;
** Goto Run-&amp;gt;Run&lt;br /&gt;
*** This creates the file Autism Collaborative\Game\Game\Output\tAC_Installer.exe&lt;br /&gt;
&lt;br /&gt;
===Upload the Installer to the Web===&lt;br /&gt;
&lt;br /&gt;
* Get a username/password for autismcollaborative.org from Matthew.&lt;br /&gt;
* Use a secure FTP client to login, such as WinSCP&lt;br /&gt;
** Either download it or run Autism Collaborative\Utilities\WinSCP.exe&lt;br /&gt;
* Login to autismcollaborative.org (port 22)&lt;br /&gt;
* Upload tAC_Installer.exe to your home directory (for example \home\zinsser)&lt;br /&gt;
** Do not overwrite the existing installer (\home\belmonte\autismcollaborative.org\downloads\AstropolisSetup.exe) since that would delete the installer from the website until the new installer finishes uploading (usually over an hour!)&lt;br /&gt;
* Once the upload is complete, enter the command &amp;quot;mv \home\zinsser\tAC_Installer.exe \home\belmonte\autismcollaborative.org\downloads\AstropolisSetup.exe&amp;quot; (you may have to open a terminal first, depending on your SFTP client)&lt;br /&gt;
** In the above command, substitute your username for &amp;quot;zinsser&amp;quot;, but keep &amp;quot;belmonte&amp;quot; as the destination user directory&lt;br /&gt;
** If there is a permissions problem, contact Matthew to make sure your user has permission to the autismcollaborative.org directory!&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=167</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=167"/>
				<updated>2008-02-06T02:13:48Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
* See the Load a Texture section for naming conventions of texture assets&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT use XNA.Framework.GameTime.ElapsedGameTime&amp;#039;&amp;#039;&amp;#039; because tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Use Images==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine augments XNA&amp;#039;s already great image support by automatically shrinking images based on a global Level Of Detail property. This means you can use it to load a graphic and the engine will automatically shrink its resolution if the Texture Detail settings are changed (via an in-game menu or a script) to Medium or Low (High retains the full resolution). This is more important for the main game since it will need to display a complex 3D scene, and minigames that just use a handful of sprites can essentially ignore this feature.&lt;br /&gt;
&lt;br /&gt;
This is accomplished by discarding the first 0-2 mipmaps of an image. As a result, images without mipmaps (most &amp;quot;common&amp;quot; types like JPEG, PNG, GIF, TIFF) will always be loaded at their max resolution. For that reason, use DDS (or another XNA-supported mipmappable format) for 3D model textures. A DDS plugin for Photoshop is available at [http://developer.nvidia.com/object/nv_texture_tools.html NVidia&amp;#039;s website].&lt;br /&gt;
&lt;br /&gt;
To allow tAC_Engine to determine the appropriate resolution, each texture asset should be tagged with a &amp;quot;_Hi&amp;quot;, &amp;quot;_Med&amp;quot;, or &amp;quot;_Lo&amp;quot; as in &amp;quot;myImage_Hi.dds&amp;quot;. If an image does not contain a detail tag at the end of its filename (before the extension) then the engine assumes it is at High resolution and will scale it down if the LOD property is Medium or lower. Most source images will have the &amp;quot;_Hi&amp;quot; tag, but some (like small objects or icons) may use the &amp;quot;_Med&amp;quot; or even &amp;quot;_Lo&amp;quot; setting to prevent the engine from downsampling them to the point where they are unrecognizable.&lt;br /&gt;
&lt;br /&gt;
===Load a Texture===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT use XNA&amp;#039;s ContentManager&amp;#039;&amp;#039;&amp;#039; to load an asset in code unless you want the asset to ignore tAC_Engine.TextureManager.LOD property. The ContentManager should only be used in engine code when appropriate; games should always use the TextureManager.&lt;br /&gt;
&lt;br /&gt;
But before you can load a texture in code you must add it to the content pipeline:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
&lt;br /&gt;
Once that&amp;#039;s done, you can load it memory with the TextureManager:&lt;br /&gt;
&lt;br /&gt;
 Texture2D myTexture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Do not include the &amp;quot;_Hi&amp;quot; (or &amp;quot;_Med&amp;quot; or &amp;quot;_Lo&amp;quot;) naming convention or the file extension call to TextureManager.Load().&lt;br /&gt;
&lt;br /&gt;
===Display a Static Image===&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a minigame will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
===Display an Animation===&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are currently no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) or mouse accessors (Xna.Framework.Input.MouseState) because tAC_Engine does a lot of caching and logging behind the scenes. Use tAC_Engine.InputState instead.&lt;br /&gt;
&lt;br /&gt;
===Keyboard===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.A))&lt;br /&gt;
 {&lt;br /&gt;
   // The A key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Mouse===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsMouseLeftUp &amp;amp;&amp;amp; InputState.WasMouseLeftDown)&lt;br /&gt;
 {&lt;br /&gt;
  // The mouse was just clicked (clicks are typically registered on the release, not the initial press)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 Vector2 location = InputState.MouseLocation;&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Use the HUD class for any HUD element (like health bars, menu buttons, etc.). Typically, you&amp;#039;ll want to create a class that inherits from Widget2D. See MeteorWidgets.cs for examples.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Publish the Installer==&lt;br /&gt;
&lt;br /&gt;
===Create the Installer===&lt;br /&gt;
&lt;br /&gt;
We use InnoSetup to create the installer. Checkout their website (http://www.jrsoftware.org/isinfo.php) if you need to change the script, but simply publishing the game does not require any adjustment to the installer script.&lt;br /&gt;
&lt;br /&gt;
* Install InnoSetup if necessary&lt;br /&gt;
** Run Autism Collaborative\Utilities\Installer Installer\isetup-5.2.2.exe&lt;br /&gt;
* Compile the installer script&lt;br /&gt;
** Open Autism Collaborative\Game\Game\Installer.iss with InnoSetup&lt;br /&gt;
** Goto Run-&amp;gt;Run&lt;br /&gt;
*** This creates the file Autism Collaborative\Game\Game\Output\tAC_Installer.exe&lt;br /&gt;
&lt;br /&gt;
===Upload the Installer to the Web===&lt;br /&gt;
&lt;br /&gt;
* Get a username/password for autismcollaborative.org from Matthew.&lt;br /&gt;
* Use a secure FTP client to login, such as WinSCP&lt;br /&gt;
** Either download it or run Autism Collaborative\Utilities\WinSCP.exe&lt;br /&gt;
* Login to autismcollaborative.org (port 22)&lt;br /&gt;
* Upload tAC_Installer.exe to your home directory (for example \home\zinsser)&lt;br /&gt;
** Do not overwrite the existing installer (\home\belmonte\autismcollaborative.org\downloads\AstropolisSetup.exe) since that would delete the installer from the website until the new installer finishes uploading (usually over an hour!)&lt;br /&gt;
* Once the upload is complete, enter the command &amp;quot;mv \home\zinsser\tAC_Installer.exe \home\belmonte\autismcollaborative.org\downloads\AstropolisSetup.exe&amp;quot; (you may have to open a terminal first, depending on your SFTP client)&lt;br /&gt;
** In the above command, substitute your username for &amp;quot;zinsser&amp;quot;, but keep &amp;quot;belmonte&amp;quot; as the destination user directory&lt;br /&gt;
** If there is a permissions problem, contact Matthew to make sure your user has permission to the autismcollaborative.org directory!&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=162</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=162"/>
				<updated>2008-01-18T15:40:32Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Manage a Heads Up Display */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
* See the Load a Texture section for naming conventions of texture assets&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT use XNA.Framework.GameTime.ElapsedGameTime&amp;#039;&amp;#039;&amp;#039; because tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Use Images==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine augments XNA&amp;#039;s already great image support by automatically shrinking images based on a global Level Of Detail property. This means you can use it to load a graphic and the engine will automatically shrink its resolution if the Texture Detail settings are changed (via an in-game menu or a script) to Medium or Low (High retains the full resolution). This is more important for the main game since it will need to display a complex 3D scene, and minigames that just use a handful of sprites can essentially ignore this feature.&lt;br /&gt;
&lt;br /&gt;
This is accomplished by discarding the first 0-2 mipmaps of an image. As a result, images without mipmaps (most &amp;quot;common&amp;quot; types like JPEG, PNG, GIF, TIFF) will always be loaded at their max resolution. For that reason, use DDS (or another XNA-supported mipmappable format) for 3D model textures. A DDS plugin for Photoshop is available at [http://developer.nvidia.com/object/nv_texture_tools.html NVidia&amp;#039;s website].&lt;br /&gt;
&lt;br /&gt;
To allow tAC_Engine to determine the appropriate resolution, each texture asset should be tagged with a &amp;quot;_Hi&amp;quot;, &amp;quot;_Med&amp;quot;, or &amp;quot;_Lo&amp;quot; as in &amp;quot;myImage_Hi.dds&amp;quot;. If an image does not contain a detail tag at the end of its filename (before the extension) then the engine assumes it is at High resolution and will scale it down if the LOD property is Medium or lower. Most source images will have the &amp;quot;_Hi&amp;quot; tag, but some (like small objects or icons) may use the &amp;quot;_Med&amp;quot; or even &amp;quot;_Lo&amp;quot; setting to prevent the engine from downsampling them to the point where they are unrecognizable.&lt;br /&gt;
&lt;br /&gt;
===Load a Texture===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT use XNA&amp;#039;s ContentManager&amp;#039;&amp;#039;&amp;#039; to load an asset in code unless you want the asset to ignore tAC_Engine.TextureManager.LOD property. The ContentManager should only be used in engine code when appropriate; games should always use the TextureManager.&lt;br /&gt;
&lt;br /&gt;
But before you can load a texture in code you must add it to the content pipeline:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
&lt;br /&gt;
Once that&amp;#039;s done, you can load it memory with the TextureManager:&lt;br /&gt;
&lt;br /&gt;
 Texture2D myTexture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Do not include the &amp;quot;_Hi&amp;quot; (or &amp;quot;_Med&amp;quot; or &amp;quot;_Lo&amp;quot;) naming convention or the file extension call to TextureManager.Load().&lt;br /&gt;
&lt;br /&gt;
===Display a Static Image===&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a minigame will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
===Display an Animation===&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are currently no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) or mouse accessors (Xna.Framework.Input.MouseState) because tAC_Engine does a lot of caching and logging behind the scenes. Use tAC_Engine.InputState instead.&lt;br /&gt;
&lt;br /&gt;
===Keyboard===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.A))&lt;br /&gt;
 {&lt;br /&gt;
   // The A key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Mouse===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsMouseLeftUp &amp;amp;&amp;amp; InputState.WasMouseLeftDown)&lt;br /&gt;
 {&lt;br /&gt;
  // The mouse was just clicked (clicks are typically registered on the release, not the initial press)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 Vector2 location = InputState.MouseLocation;&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Use the HUD class for any HUD element (like health bars, menu buttons, etc.). Typically, you&amp;#039;ll want to create a class that inherits from Widget2D. See MeteorWidgets.cs for examples.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=161</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=161"/>
				<updated>2008-01-18T15:38:27Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Get User Input */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
* See the Load a Texture section for naming conventions of texture assets&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT use XNA.Framework.GameTime.ElapsedGameTime&amp;#039;&amp;#039;&amp;#039; because tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Use Images==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine augments XNA&amp;#039;s already great image support by automatically shrinking images based on a global Level Of Detail property. This means you can use it to load a graphic and the engine will automatically shrink its resolution if the Texture Detail settings are changed (via an in-game menu or a script) to Medium or Low (High retains the full resolution). This is more important for the main game since it will need to display a complex 3D scene, and minigames that just use a handful of sprites can essentially ignore this feature.&lt;br /&gt;
&lt;br /&gt;
This is accomplished by discarding the first 0-2 mipmaps of an image. As a result, images without mipmaps (most &amp;quot;common&amp;quot; types like JPEG, PNG, GIF, TIFF) will always be loaded at their max resolution. For that reason, use DDS (or another XNA-supported mipmappable format) for 3D model textures. A DDS plugin for Photoshop is available at [http://developer.nvidia.com/object/nv_texture_tools.html NVidia&amp;#039;s website].&lt;br /&gt;
&lt;br /&gt;
To allow tAC_Engine to determine the appropriate resolution, each texture asset should be tagged with a &amp;quot;_Hi&amp;quot;, &amp;quot;_Med&amp;quot;, or &amp;quot;_Lo&amp;quot; as in &amp;quot;myImage_Hi.dds&amp;quot;. If an image does not contain a detail tag at the end of its filename (before the extension) then the engine assumes it is at High resolution and will scale it down if the LOD property is Medium or lower. Most source images will have the &amp;quot;_Hi&amp;quot; tag, but some (like small objects or icons) may use the &amp;quot;_Med&amp;quot; or even &amp;quot;_Lo&amp;quot; setting to prevent the engine from downsampling them to the point where they are unrecognizable.&lt;br /&gt;
&lt;br /&gt;
===Load a Texture===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT use XNA&amp;#039;s ContentManager&amp;#039;&amp;#039;&amp;#039; to load an asset in code unless you want the asset to ignore tAC_Engine.TextureManager.LOD property. The ContentManager should only be used in engine code when appropriate; games should always use the TextureManager.&lt;br /&gt;
&lt;br /&gt;
But before you can load a texture in code you must add it to the content pipeline:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
&lt;br /&gt;
Once that&amp;#039;s done, you can load it memory with the TextureManager:&lt;br /&gt;
&lt;br /&gt;
 Texture2D myTexture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Do not include the &amp;quot;_Hi&amp;quot; (or &amp;quot;_Med&amp;quot; or &amp;quot;_Lo&amp;quot;) naming convention or the file extension call to TextureManager.Load().&lt;br /&gt;
&lt;br /&gt;
===Display a Static Image===&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a minigame will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
===Display an Animation===&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are currently no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) or mouse accessors (Xna.Framework.Input.MouseState) because tAC_Engine does a lot of caching and logging behind the scenes. Use tAC_Engine.InputState instead.&lt;br /&gt;
&lt;br /&gt;
===Keyboard===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.A))&lt;br /&gt;
 {&lt;br /&gt;
   // The A key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Mouse===&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsMouseLeftUp &amp;amp;&amp;amp; InputState.WasMouseLeftDown)&lt;br /&gt;
 {&lt;br /&gt;
  // The mouse was just clicked (clicks are typically registered on the release, not the initial press)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 Vector2 location = InputState.MouseLocation;&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Not yet implemented.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=160</id>
		<title>Dev Setup</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Dev_Setup&amp;diff=160"/>
				<updated>2008-01-14T14:54:24Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Start Developing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Follow these steps to run the development build of the game.&lt;br /&gt;
&lt;br /&gt;
==System Requirements==&lt;br /&gt;
&lt;br /&gt;
This game requires the following for both development and released versions:&lt;br /&gt;
&lt;br /&gt;
* Intel-based PC with at least 1.0 GHz&lt;br /&gt;
* Windows XP or Windows Vista (it has been reported that Macintosh systems running Boot Camp can run the released build, but development must be done on a Windows machine)&lt;br /&gt;
* Graphics card with Pixel Shader 1.0+ (any computer that can run Windows Vista meets this requirement)&lt;br /&gt;
&lt;br /&gt;
==Download and Install the Software==&lt;br /&gt;
&lt;br /&gt;
* [http://msdn2.microsoft.com/en-us/express/aa975050.aspx Visual C# Express Edition] - As of Oct 2007, development is in Version 1 but Version 2 may also work&lt;br /&gt;
* [http://www.microsoft.com/downloads/details.aspx?FamilyId=12ADCD12-7A7B-4413-A0AF-FF87242A78DE&amp;amp;displaylang=en XNA Game Studio Express]&lt;br /&gt;
* [http://tortoisesvn.net/downloads Tortoise SVN] - or other Subversion Client&lt;br /&gt;
&lt;br /&gt;
==Download the Code==&lt;br /&gt;
&lt;br /&gt;
* Obtain a Subversion username and password from a Subversion Admin (Matthew or August). The username will be used to track your changes to the code repository and the password will be known by all Subversion Admins, so don&amp;#039;t use your &amp;quot;real&amp;quot; password!&lt;br /&gt;
* Checkout the Repository&lt;br /&gt;
** Create a new directory called &amp;quot;Autism Collaborative&amp;quot; (or something else if you&amp;#039;re a rebel)&lt;br /&gt;
** Right click on the folder and select TortsoiseSVN-&amp;gt;Checkout... from the popup menu&lt;br /&gt;
** In the URL of repository field, enter http://www.autismcollaborative.org/autism_collaborative&lt;br /&gt;
** Click OK&lt;br /&gt;
* Register the code dependencies&lt;br /&gt;
** Browse to Autism Collaborative\Dependencies&lt;br /&gt;
** Run RegisterDependencies.bat&lt;br /&gt;
&lt;br /&gt;
==Run the Game==&lt;br /&gt;
&lt;br /&gt;
New users of Visual Studio or similar IDE (Integrated Development Environment) should check out Microsoft&amp;#039;s [http://msdn.microsoft.com/vstudio/express/beginner/ Online Learning Center].&lt;br /&gt;
&lt;br /&gt;
==Start Developing==&lt;br /&gt;
&lt;br /&gt;
Check out the [[Code Overview]] for an explanation of how the code base works. It may also be helpful to visit the [[Code How To&amp;#039;s]] for explanations of common coding tasks. And don&amp;#039;t forget about the weekly [[Meetings]]!&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Main_Page&amp;diff=159</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Main_Page&amp;diff=159"/>
				<updated>2008-01-14T14:53:23Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Major Sections */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Welcome to the Autism Game wiki&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The Motivation==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Integrative studies of perception, attention, and social cognition in autism&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Although much progress has been made identifying structural and functional profiles in autism, this work has resulted in a multiplicity of hypotheses targeted at particular brain or cognitive subsystems or levels of analysis; our most vexing problem often is not identifying the observational details, but assembling these details into a coherent theory.  The division between social and non-social studies of autism is a case in point.  Competing theories have construed autism variously as an exclusively social deficit in &amp;quot;theory of mind,&amp;quot; an abnormality of attention and executive function with social and non-social consequences, an atypical weakness in &amp;quot;central coherence,&amp;quot; or an enhancement of perceptual function.  Although each of these views seems to capture a piece of the truth, a synthesis of all of them will not be possible as long as they continue to be approached as competing rather than synergistic views, as long as their psychological descriptions remain incompletely connected to neurobiological explanations and to clinical impairments, and as long as individual experiments continue to collect data germane to only one theory in isolation.&lt;br /&gt;
&lt;br /&gt;
==The Strategy==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Embed a suite of psychological experiments within a video game that&amp;#039;s fun to play&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Perhaps the single most important obstacle to integrative studies of autism is the practical limit on the amount of time that a single experimental subject can reasonably be expected to perform before becoming fatigued.  Unfortunately, often the more controlled a stimulus is from the scientist&amp;#039;s point of view, the more repetitive and tedious the experiment can seem from the subject&amp;#039;s point of view.  Behavioural research on autism in recent years has highlighted the importance of motivation, behavioural set, and task instruction in establishing cognitive strategy and determining performance (e.g. Plaisted et al. 1999; Dalton et al. 2005).  In light of these considerations, we propose to embed experimental stimuli in the context of a video game that captures and maintains subjects&amp;#039; interest, transparently collecting behavioural data and synchronising with physiological recording as the subject plays the game.  The practical advantages of such an engaging and ecologically valid format over the usual repetitive blocks of trials are legion.  Indeed, varying levels and demands of attentional shifting and multimodal integration are natural in the context of video game play, and psychophysical measures such as dot motion coherence and embedded figures are easily implemented as, for example, the movement of a star field on a view screen and the detection of an adversary in a cluttered environment.  In addition, the strategic and adversarial nature of a video game carries natural opportunities to explore higher-level cognitive measures such as comprehension of game-related narratives and social attribution to a computer-generated adversary.  The video game format is increasingly being used to acquire simultaneous behavioural and EEG observations in ecologically valid contexts, for example in visuomotor tracking (Smith et al. 1999), air traffic control (Brookings et al. 1996), and military command and control simulations (St John et al. 2002, 2004; Berka et al. 2004).  Recent results in human-computer interaction (von Ahn 2006) also point to the power of the game context to establish and to maintain motivation in tasks that otherwise might not seem engaging, and to teach persons with developmental disorders (Golan &amp;amp; Baron-Cohen 2006).  Also along these lines, the video game format affords subjects more of a chance to become comfortable with the task before entering the laboratory, minimising the potential confound of state anxiety associated with performance of an unfamiliar task in a testing situation.&lt;br /&gt;
&lt;br /&gt;
==Major Sections==&lt;br /&gt;
&lt;br /&gt;
[[Plot]]&lt;br /&gt;
&lt;br /&gt;
[[Functional specifications]]&lt;br /&gt;
&lt;br /&gt;
[[Meetings]]&lt;br /&gt;
&lt;br /&gt;
[[Dev Setup]]&lt;br /&gt;
&lt;br /&gt;
[[Code How To&amp;#039;s]]&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Meetings&amp;diff=158</id>
		<title>Meetings</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Meetings&amp;diff=158"/>
				<updated>2008-01-14T14:52:39Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: New page: &amp;#039;&amp;#039;&amp;#039;Skype&amp;#039;&amp;#039;&amp;#039;  &amp;#039;&amp;#039;&amp;#039;Tuesdays&amp;#039;&amp;#039;&amp;#039;  &amp;#039;&amp;#039;&amp;#039;Noon&amp;#039;&amp;#039;&amp;#039;   The developers and Matthew have weekly teleconferences via Skype. Just sign in and August or Matthew will start a conference call. By 10am that da...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Skype&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Tuesdays&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Noon&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The developers and Matthew have weekly teleconferences via Skype. Just sign in and August or Matthew will start a conference call. By 10am that day, each developer should email his/her Accomplishments since the last meeting and Objectives for the next meeting (A&amp;#039;s and O&amp;#039;s) to the programmer listserv.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Meteor_Madness&amp;diff=157</id>
		<title>Meteor Madness</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Meteor_Madness&amp;diff=157"/>
				<updated>2008-01-12T18:17:32Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Display Name: &amp;#039;&amp;#039;&amp;#039;Maritime Defender&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[image:MaritimeDefender05.jpg|thumb|right]] [[image:MaritimeDefender04.jpg|thumb|right]] [[image:MaritimeDefender07.jpg|thumb|right]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
This mini-game resembles the arcade games Tempest and Asteroids, and combines tests of motion coherence threshold, motor inhibition, and executive flexibility.  The player commands a spaceship that moves clockwise (left arrow key) or counterclockwise (right arrow key) around the perimeter of a circular field.  Slow-moving meteors materialise at the centre of the field and drift outward; the player must fire torpedoes (space bar) to destroy these meteors. (This ongoing task serves simply to maintain vigilance.)  Periodically, a wormhole materialises within the field.  The player can open this wormhole by moving around the circle to align with it, then connecting with the wormhole (up arrow). Connecting temporarily drains the ship&amp;#039;s propulsion systems; the ship is locked in place in front of the wormhole as an unidentified ship begins to emerge.  This ship can be either a friend or a foe, with equal probability.  Friend and foe ships are identical in area and luminance, but differ subtly in form: one has two warp nacelles protruding, the other three.  Foes should be fired upon and destroyed before they get a chance to attack the player.  Conversely, withholding fire on a friend is rewarded by a weapons power-up which increases the player&amp;#039;s firing rate.  (This change in firing rate alters the game tactically but does not affect measurement of reaction times.)  Friends and foes cannot be discriminated until they have emerged from the wormhole.  Thus during the opening of the wormhole the player must prepare, but not execute, a motor response.  Foes do not fire, and friends do not deliver weapons power-ups, until 800 ms after emerging.  A hit in this task is therefore defined as firing on a foe within this 800 ms interval, a miss as failing to fire on a foe within this interval, a correct rejection as withholding fire on a friend, and a false alarm as firing on a friend.  This task behaviourally measures inhibitory function, and can be used in conjunction with EEG measures to assess motor planning.&lt;br /&gt;
&lt;br /&gt;
Friendly and enemy forces in this game are pirates or mercenaries who have requested the player&amp;#039;s help (to fend off the pirates). The class of ship used by each side therefore can change from one session of the game to the next.  A &amp;#039;&amp;#039;&amp;#039;shift&amp;#039;&amp;#039;&amp;#039; session is one in which the assignment of ship classes differs from that of the session immediately preceding.  A &amp;#039;&amp;#039;&amp;#039;hold&amp;#039;&amp;#039;&amp;#039; session is one in which the assignment of ship classes does not differ from that of a session immediately preceding.  Differences in reaction time and accuracy for the fire-or-withhold task between shift and hold sessions measure executive flexibility.&lt;br /&gt;
&lt;br /&gt;
After the player has completed a session of five wormhole connections, the ship warps to another meteor field.  Whilst in warp, the player views a field of 200 stars (white dots on a black background), a percentage of which move coherently in one direction, either left or right. Other stars move in random directions.  Each star appears in the field for four video frames, or until its motion carries it outside the boundary of the field.  Coherent motion of the star field signals that the ship is veering right (for leftwards apparent motion) or left (for rightwards apparent motion) of its intended course.  The player&amp;#039;s task is to compensate for this drift by steering left (left arrow) when leftwards apparent motion is perceived, and right (right arrow) when rightwards apparent motion is perceived.  Failure to compensate for an actual drift or compensation when no drift is present causes the ship to collide with this mysterious subspace matter, draining its shield and possibly resulting in its destruction.  Each drift interval lasts 2 seconds plus a random and uniformly distributed interval between 0 and 250 ms, or until a course correction is commanded.  The player&amp;#039;s motion coherence threshold is estimated via parameter estimation by sequential testing (PEST).  Since the threshold adjusts to the player, it is expected that about half of the trials will result in a failure.  To avoid frustrating the player, approximately every 4 trials is a dummy trial with an artificially high coherence threshold. &lt;br /&gt;
&lt;br /&gt;
==Premise==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;nearby&amp;quot; freighter is under attack by marauders! Warp to its location and destroy all hostile forces before it&amp;#039;s too late. Friendly escort ships will assist you with weapon upgrades.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
&lt;br /&gt;
Salvage as many survivors and goods as possible whilst keeping your own ship alive.&lt;br /&gt;
&lt;br /&gt;
==Characters==&lt;br /&gt;
&lt;br /&gt;
[[image:Cheetah_300.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Cheetah C-24 Fighters:&amp;#039;&amp;#039;&amp;#039; The colony&amp;#039;s squadron of high-speed attack ships.  They are equipped with magnetic photonic torpedoes.  The Cheetah&amp;#039;s shields are capable of absorbing substantial energy surges before becoming vulnerable to enemy fire or physical collision.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Wormhole:&amp;#039;&amp;#039;&amp;#039;  Requires 2 entities to open; one on each side.  These appear during the shooter phase and with the help of the player allow a resource or a hostile to warp through to the player&amp;#039;s location.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Drone_300.png]] [[image:Wasp_300.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;UFO1,2:&amp;#039;&amp;#039;&amp;#039; Marauding space pirates or mercenaries (depending on the session).  They are both equipped with weapons and capable of destroying C-24 Fighters.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Meteorites:&amp;#039;&amp;#039;&amp;#039;  Come in a couple of different shapes and sizes.  Slamming into one causes a hit on a ship&amp;#039;s shields or destruction if the ship&amp;#039;s shields have failed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Subspace Matter:&amp;#039;&amp;#039;&amp;#039;  Random particles that fly through space in a logical manner when piloting at regular speeds, however in warp drive they seem to defy the laws of physics.&lt;br /&gt;
&lt;br /&gt;
==Gameplay==&lt;br /&gt;
&lt;br /&gt;
There are 3 phases to this minigame.  The game begins at level 1 in the shooter phase.  After this, the ship uses a wormhole to enter a warp-jump phase that lasts for about 15 seconds. This cycle is repeated 4 times (unless the player dies). The final phase is a boss phase.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The player&amp;#039;s shield persists through all phases.  After taking a hit, the shield is reduced by 1/2.  Thus, 2 hits are enough to deplete the shield, leaving the player only 1 more hit before dying in an exploserous ball of flame.  Shields slowly recharge over time (about 10 seconds for a full charge, but this number will likely change upon play-testing), but once a shield is fully depleted it does not recharge leaving the ship permanently vulnerable to one more hit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Warp-Jump Phase&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This phase tests the subject&amp;#039;s Motion Coherence.  During warp-jumps, the mysterious dots move in a mostly random manner.  A small percentage of these particles begin to drift in the same direction indicating that the ship is veering off course.  The player must correct the ship&amp;#039;s course by pressing the arrow key corresponding to that directional drift.  Once the drift starts, the player has only a couple seconds to react.  If no correction is made in time, the ship slams into debris and takes a hit.  This phase ends after a set amount of time which is not disclosed to the player or the ship is destroyed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The percentage of drifting stars is determined by PEST.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dog Fight Phase&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This phase tests the subject&amp;#039;s focused spatial attention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The playing field consists of an invisible cylinder whose caps are parallel to the camera&amp;#039;s viewing plane.  The player&amp;#039;s ship is located at the near cap.  All entities can only exist on the cylinder&amp;#039;s circumference but may rotate around it or move up and down it lengthwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The player may fire, sending projectiles down the cylinder lengthwise.  At first, the rate of fire is fairly slow, but as the player collects powerups from friendly ships that rate increases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It may be necessary to add a wingman if many autistic players have trouble with this phase.  The wingman would automatically move and fire upon enemies/meteors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wormholes appear at the far cylinder cap.  The player can align his/her ship with a wormhole and activate it.  A short time later, a ship (friendly or foe) replaces the wormhole.  The player should immediately fire and attempt to destroy any hostiles.  Should the player fire enough times upon a mercenary, it is destroyed. If a mercenary survives the trial, it awards the player with a weapon upgrade. Similarly, if a hostile is destroyed it leaves a small cash collectible behind.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additionally, meteorites appear at the far cylinder cap and scroll down its circumference towards the camera.  If they hit a ship, then the meteor is destroyed and the ship&amp;#039;s shield takes a hit.  Meteors will not appear in a column that is occupied by a wormhole.  Meteors can be destroyed by shooting them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boss Phase&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The final phase is a boss battle. This boss will not be incredibly difficult, but serves mostly to give the player a sense of accomplishment and reward them by letting them blast the away at a something with their upgraded lasers.&lt;br /&gt;
&lt;br /&gt;
==User Interface==&lt;br /&gt;
&lt;br /&gt;
For the warp phase, the only input will be left and right arrow keys to indicate a course correction. The HUD consists of a inner-cockpit view. The cockpit will remain static during test trials, but between trials will blink or sound to provide positive/negative feedback for successful/failed trials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While in the shooter phase, pressing the left arrow key rotates the player&amp;#039;s ship clockwise, while right rotates it counterclockwise.  This would normally seem counterintuitive, but in this case the player&amp;#039;s ship is displayed upright when it is near the bottom of the screen.  Therefore, pressing left always shifts the C-24 to its port side.  Spacebar fires weapons.  Pressing the up arrow key will attempt to open a partial wormhole.  This attempt is successful if the player is aligned with the wormhole (ie, they are near the same position on the opposite cylinder caps).  A different color beam will indicate a successful or failed wormhole activation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To minimize distraction, the shooter phase has no HUD. Shield power feedback is given through the color and opacity of the shield particle effect when a player gets hit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The UI for the boss phase is identical to the shooter phase.&lt;br /&gt;
&lt;br /&gt;
==Scoring==&lt;br /&gt;
&lt;br /&gt;
Defeating the boss rewards a lump sum of cash.  A colony structure is awarded if the player collects enough powerups.  Any cash collected from destroyed enemies is also kept.  Money is subtracted for the cost of each derelict ship destroyed by the player.  If this dips the reward into negative money, then the money rewarded is set to 0.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=File:MaritimeDefender07.jpg&amp;diff=156</id>
		<title>File:MaritimeDefender07.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=File:MaritimeDefender07.jpg&amp;diff=156"/>
				<updated>2008-01-12T18:03:40Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=File:MaritimeDefender04.jpg&amp;diff=155</id>
		<title>File:MaritimeDefender04.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=File:MaritimeDefender04.jpg&amp;diff=155"/>
				<updated>2008-01-12T18:03:13Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=File:MaritimeDefender05.jpg&amp;diff=154</id>
		<title>File:MaritimeDefender05.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=File:MaritimeDefender05.jpg&amp;diff=154"/>
				<updated>2008-01-12T18:02:43Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Meteor_Madness&amp;diff=153</id>
		<title>Meteor Madness</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Meteor_Madness&amp;diff=153"/>
				<updated>2008-01-12T18:01:48Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Display Name: &amp;#039;&amp;#039;&amp;#039;Maritime Defender&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[image:wormhole_small.png]] [[image:foe_small.png]] [[image:explosion_small.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
This mini-game resembles the arcade games Tempest and Asteroids, and combines tests of motion coherence threshold, motor inhibition, and executive flexibility.  The player commands a spaceship that moves clockwise (left arrow key) or counterclockwise (right arrow key) around the perimeter of a circular field.  Slow-moving meteors materialise at the centre of the field and drift outward; the player must fire torpedoes (space bar) to destroy these meteors. (This ongoing task serves simply to maintain vigilance.)  Periodically, a wormhole materialises within the field.  The player can open this wormhole by moving around the circle to align with it, then connecting with the wormhole (up arrow). Connecting temporarily drains the ship&amp;#039;s propulsion systems; the ship is locked in place in front of the wormhole as an unidentified ship begins to emerge.  This ship can be either a friend or a foe, with equal probability.  Friend and foe ships are identical in area and luminance, but differ subtly in form: one has two warp nacelles protruding, the other three.  Foes should be fired upon and destroyed before they get a chance to attack the player.  Conversely, withholding fire on a friend is rewarded by a weapons power-up which increases the player&amp;#039;s firing rate.  (This change in firing rate alters the game tactically but does not affect measurement of reaction times.)  Friends and foes cannot be discriminated until they have emerged from the wormhole.  Thus during the opening of the wormhole the player must prepare, but not execute, a motor response.  Foes do not fire, and friends do not deliver weapons power-ups, until 800 ms after emerging.  A hit in this task is therefore defined as firing on a foe within this 800 ms interval, a miss as failing to fire on a foe within this interval, a correct rejection as withholding fire on a friend, and a false alarm as firing on a friend.  This task behaviourally measures inhibitory function, and can be used in conjunction with EEG measures to assess motor planning.&lt;br /&gt;
&lt;br /&gt;
Friendly and enemy forces in this game are pirates or mercenaries who have requested the player&amp;#039;s help (to fend off the pirates). The class of ship used by each side therefore can change from one session of the game to the next.  A &amp;#039;&amp;#039;&amp;#039;shift&amp;#039;&amp;#039;&amp;#039; session is one in which the assignment of ship classes differs from that of the session immediately preceding.  A &amp;#039;&amp;#039;&amp;#039;hold&amp;#039;&amp;#039;&amp;#039; session is one in which the assignment of ship classes does not differ from that of a session immediately preceding.  Differences in reaction time and accuracy for the fire-or-withhold task between shift and hold sessions measure executive flexibility.&lt;br /&gt;
&lt;br /&gt;
After the player has completed a session of five wormhole connections, the ship warps to another meteor field.  Whilst in warp, the player views a field of 200 stars (white dots on a black background), a percentage of which move coherently in one direction, either left or right. Other stars move in random directions.  Each star appears in the field for four video frames, or until its motion carries it outside the boundary of the field.  Coherent motion of the star field signals that the ship is veering right (for leftwards apparent motion) or left (for rightwards apparent motion) of its intended course.  The player&amp;#039;s task is to compensate for this drift by steering left (left arrow) when leftwards apparent motion is perceived, and right (right arrow) when rightwards apparent motion is perceived.  Failure to compensate for an actual drift or compensation when no drift is present causes the ship to collide with this mysterious subspace matter, draining its shield and possibly resulting in its destruction.  Each drift interval lasts 2 seconds plus a random and uniformly distributed interval between 0 and 250 ms, or until a course correction is commanded.  The player&amp;#039;s motion coherence threshold is estimated via parameter estimation by sequential testing (PEST).  Since the threshold adjusts to the player, it is expected that about half of the trials will result in a failure.  To avoid frustrating the player, approximately every 4 trials is a dummy trial with an artificially high coherence threshold. &lt;br /&gt;
&lt;br /&gt;
==Premise==&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;nearby&amp;quot; freighter is under attack by marauders! Warp to its location and destroy all hostile forces before it&amp;#039;s too late. Friendly escort ships will assist you with weapon upgrades.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
&lt;br /&gt;
Salvage as many survivors and goods as possible whilst keeping your own ship alive.&lt;br /&gt;
&lt;br /&gt;
==Characters==&lt;br /&gt;
&lt;br /&gt;
[[image:Cheetah_300.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Cheetah C-24 Fighters:&amp;#039;&amp;#039;&amp;#039; The colony&amp;#039;s squadron of high-speed attack ships.  They are equipped with magnetic photonic torpedoes.  The Cheetah&amp;#039;s shields are capable of absorbing substantial energy surges before becoming vulnerable to enemy fire or physical collision.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Wormhole:&amp;#039;&amp;#039;&amp;#039;  Requires 2 entities to open; one on each side.  These appear during the shooter phase and with the help of the player allow a resource or a hostile to warp through to the player&amp;#039;s location.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[image:Drone_300.png]] [[image:Wasp_300.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;UFO1,2:&amp;#039;&amp;#039;&amp;#039; Marauding space pirates or mercenaries (depending on the session).  They are both equipped with weapons and capable of destroying C-24 Fighters.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Meteorites:&amp;#039;&amp;#039;&amp;#039;  Come in a couple of different shapes and sizes.  Slamming into one causes a hit on a ship&amp;#039;s shields or destruction if the ship&amp;#039;s shields have failed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Subspace Matter:&amp;#039;&amp;#039;&amp;#039;  Random particles that fly through space in a logical manner when piloting at regular speeds, however in warp drive they seem to defy the laws of physics.&lt;br /&gt;
&lt;br /&gt;
==Gameplay==&lt;br /&gt;
&lt;br /&gt;
There are 3 phases to this minigame.  The game begins at level 1 in the shooter phase.  After this, the ship uses a wormhole to enter a warp-jump phase that lasts for about 15 seconds. This cycle is repeated 4 times (unless the player dies). The final phase is a boss phase.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The player&amp;#039;s shield persists through all phases.  After taking a hit, the shield is reduced by 1/2.  Thus, 2 hits are enough to deplete the shield, leaving the player only 1 more hit before dying in an exploserous ball of flame.  Shields slowly recharge over time (about 10 seconds for a full charge, but this number will likely change upon play-testing), but once a shield is fully depleted it does not recharge leaving the ship permanently vulnerable to one more hit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Warp-Jump Phase&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This phase tests the subject&amp;#039;s Motion Coherence.  During warp-jumps, the mysterious dots move in a mostly random manner.  A small percentage of these particles begin to drift in the same direction indicating that the ship is veering off course.  The player must correct the ship&amp;#039;s course by pressing the arrow key corresponding to that directional drift.  Once the drift starts, the player has only a couple seconds to react.  If no correction is made in time, the ship slams into debris and takes a hit.  This phase ends after a set amount of time which is not disclosed to the player or the ship is destroyed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The percentage of drifting stars is determined by PEST.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Dog Fight Phase&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This phase tests the subject&amp;#039;s focused spatial attention.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The playing field consists of an invisible cylinder whose caps are parallel to the camera&amp;#039;s viewing plane.  The player&amp;#039;s ship is located at the near cap.  All entities can only exist on the cylinder&amp;#039;s circumference but may rotate around it or move up and down it lengthwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The player may fire, sending projectiles down the cylinder lengthwise.  At first, the rate of fire is fairly slow, but as the player collects powerups from friendly ships that rate increases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It may be necessary to add a wingman if many autistic players have trouble with this phase.  The wingman would automatically move and fire upon enemies/meteors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Wormholes appear at the far cylinder cap.  The player can align his/her ship with a wormhole and activate it.  A short time later, a ship (friendly or foe) replaces the wormhole.  The player should immediately fire and attempt to destroy any hostiles.  Should the player fire enough times upon a mercenary, it is destroyed. If a mercenary survives the trial, it awards the player with a weapon upgrade. Similarly, if a hostile is destroyed it leaves a small cash collectible behind.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additionally, meteorites appear at the far cylinder cap and scroll down its circumference towards the camera.  If they hit a ship, then the meteor is destroyed and the ship&amp;#039;s shield takes a hit.  Meteors will not appear in a column that is occupied by a wormhole.  Meteors can be destroyed by shooting them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Boss Phase&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The final phase is a boss battle. This boss will not be incredibly difficult, but serves mostly to give the player a sense of accomplishment and reward them by letting them blast the away at a something with their upgraded lasers.&lt;br /&gt;
&lt;br /&gt;
==User Interface==&lt;br /&gt;
&lt;br /&gt;
For the warp phase, the only input will be left and right arrow keys to indicate a course correction. The HUD consists of a inner-cockpit view. The cockpit will remain static during test trials, but between trials will blink or sound to provide positive/negative feedback for successful/failed trials.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While in the shooter phase, pressing the left arrow key rotates the player&amp;#039;s ship clockwise, while right rotates it counterclockwise.  This would normally seem counterintuitive, but in this case the player&amp;#039;s ship is displayed upright when it is near the bottom of the screen.  Therefore, pressing left always shifts the C-24 to its port side.  Spacebar fires weapons.  Pressing the up arrow key will attempt to open a partial wormhole.  This attempt is successful if the player is aligned with the wormhole (ie, they are near the same position on the opposite cylinder caps).  A different color beam will indicate a successful or failed wormhole activation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To minimize distraction, the shooter phase has no HUD. Shield power feedback is given through the color and opacity of the shield particle effect when a player gets hit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The UI for the boss phase is identical to the shooter phase.&lt;br /&gt;
&lt;br /&gt;
==Scoring==&lt;br /&gt;
&lt;br /&gt;
Defeating the boss rewards a lump sum of cash.  A colony structure is awarded if the player collects enough powerups.  Any cash collected from destroyed enemies is also kept.  Money is subtracted for the cost of each derelict ship destroyed by the player.  If this dips the reward into negative money, then the money rewarded is set to 0.&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=152</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=152"/>
				<updated>2008-01-10T21:04:18Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Use Images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
* See the Load a Texture section for naming conventions of texture assets&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT use XNA.Framework.GameTime.ElapsedGameTime&amp;#039;&amp;#039;&amp;#039; because tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Use Images==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine augments XNA&amp;#039;s already great image support by automatically shrinking images based on a global Level Of Detail property. This means you can use it to load a graphic and the engine will automatically shrink its resolution if the Texture Detail settings are changed (via an in-game menu or a script) to Medium or Low (High retains the full resolution). This is more important for the main game since it will need to display a complex 3D scene, and minigames that just use a handful of sprites can essentially ignore this feature.&lt;br /&gt;
&lt;br /&gt;
This is accomplished by discarding the first 0-2 mipmaps of an image. As a result, images without mipmaps (most &amp;quot;common&amp;quot; types like JPEG, PNG, GIF, TIFF) will always be loaded at their max resolution. For that reason, use DDS (or another XNA-supported mipmappable format) for 3D model textures. A DDS plugin for Photoshop is available at [http://developer.nvidia.com/object/nv_texture_tools.html NVidia&amp;#039;s website].&lt;br /&gt;
&lt;br /&gt;
To allow tAC_Engine to determine the appropriate resolution, each texture asset should be tagged with a &amp;quot;_Hi&amp;quot;, &amp;quot;_Med&amp;quot;, or &amp;quot;_Lo&amp;quot; as in &amp;quot;myImage_Hi.dds&amp;quot;. If an image does not contain a detail tag at the end of its filename (before the extension) then the engine assumes it is at High resolution and will scale it down if the LOD property is Medium or lower. Most source images will have the &amp;quot;_Hi&amp;quot; tag, but some (like small objects or icons) may use the &amp;quot;_Med&amp;quot; or even &amp;quot;_Lo&amp;quot; setting to prevent the engine from downsampling them to the point where they are unrecognizable.&lt;br /&gt;
&lt;br /&gt;
===Load a Texture===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT use XNA&amp;#039;s ContentManager&amp;#039;&amp;#039;&amp;#039; to load an asset in code unless you want the asset to ignore tAC_Engine.TextureManager.LOD property. The ContentManager should only be used in engine code when appropriate; games should always use the TextureManager.&lt;br /&gt;
&lt;br /&gt;
But before you can load a texture in code you must add it to the content pipeline:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
&lt;br /&gt;
Once that&amp;#039;s done, you can load it memory with the TextureManager:&lt;br /&gt;
&lt;br /&gt;
 Texture2D myTexture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Do not include the &amp;quot;_Hi&amp;quot; (or &amp;quot;_Med&amp;quot; or &amp;quot;_Lo&amp;quot;) naming convention or the file extension call to TextureManager.Load().&lt;br /&gt;
&lt;br /&gt;
===Display a Static Image===&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a minigame will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
===Display an Animation===&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are currently no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) because tAC_Engine does a lot of caching and logging behind the scenes. Instead get keyboard input like this:&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.Left))&lt;br /&gt;
 {&lt;br /&gt;
   // The left key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If an exception is thrown stating &amp;quot;Unregistered Key Comparison&amp;quot; then add that key to the list in the InputState constructor.&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Not yet implemented.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=151</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=151"/>
				<updated>2008-01-08T02:22:33Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
* See the Load a Texture section for naming conventions of texture assets&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT use XNA.Framework.GameTime.ElapsedGameTime&amp;#039;&amp;#039;&amp;#039; because tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Use Images==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine augments XNA&amp;#039;s already great image support by automatically shrinking images based on a global Level Of Detail property. This means you can use it to load a graphic in a minigame and the engine will automatically shrink its resolution if the Texture Detail settings are changed (via an in-game menu or a script) to Medium or Low (High retains the full resolution).&lt;br /&gt;
&lt;br /&gt;
This is accomplished by discarding the first 0-2 mipmaps of an image. As a result, images without mipmaps (most &amp;quot;common&amp;quot; types like JPEG, PNG, GIF, TIFF) will always be loaded at their max resolution. For that reason, use DDS (or another XNA-supported mipmappable format) for game graphics. A DDS plugin for Photoshop is available at [http://developer.nvidia.com/object/nv_texture_tools.html NVidia&amp;#039;s website].&lt;br /&gt;
&lt;br /&gt;
To allow tAC_Engine to determine the appropriate resolution, each texture asset should be tagged with a &amp;quot;_Hi&amp;quot;, &amp;quot;_Med&amp;quot;, or &amp;quot;_Lo&amp;quot; as in &amp;quot;myImage_Hi.dds&amp;quot;. If an image does not contain a detail tag at the end of its filename (before the extension) then the engine assumes it is at High resolution and will scale it down if the LOD property is Medium or lower. Most source images will have the &amp;quot;_Hi&amp;quot; tag, but some (like small objects or icons) may use the &amp;quot;_Med&amp;quot; or even &amp;quot;_Lo&amp;quot; setting to prevent the engine from downsampling them to the point where they are unrecognizable.&lt;br /&gt;
&lt;br /&gt;
===Load a Texture===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT use XNA&amp;#039;s ContentManager&amp;#039;&amp;#039;&amp;#039; to load an asset in code unless you want the asset to ignore tAC_Engine.TextureManager.LOD property. The ContentManager should only be used in engine code when appropriate; games should always use the TextureManager.&lt;br /&gt;
&lt;br /&gt;
But before you can load a texture in code you must add it to the content pipeline:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
&lt;br /&gt;
Once that&amp;#039;s done, you can load it memory with the TextureManager:&lt;br /&gt;
&lt;br /&gt;
 Texture2D myTexture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
Do not include the &amp;quot;_Hi&amp;quot; (or &amp;quot;_Med&amp;quot; or &amp;quot;_Lo&amp;quot;) naming convention or the file extension call to TextureManager.Load().&lt;br /&gt;
&lt;br /&gt;
===Display a Static Image===&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a minigame will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = TextureManager.Load(@&amp;quot;Content\General\myTexture&amp;quot;);&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
===Display an Animation===&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are currently no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) because tAC_Engine does a lot of caching and logging behind the scenes. Instead get keyboard input like this:&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.Left))&lt;br /&gt;
 {&lt;br /&gt;
   // The left key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If an exception is thrown stating &amp;quot;Unregistered Key Comparison&amp;quot; then add that key to the list in the InputState constructor.&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Not yet implemented.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=User:Chesbrough&amp;diff=150</id>
		<title>User:Chesbrough</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=User:Chesbrough&amp;diff=150"/>
				<updated>2007-12-23T18:19:51Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: New page: A Developer for the Autism Collaborative&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Developer for the Autism Collaborative&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=User:Zinsser&amp;diff=149</id>
		<title>User:Zinsser</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=User:Zinsser&amp;diff=149"/>
				<updated>2007-12-23T18:19:43Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Developer for the Autism Collaborative&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=User:Belmonte&amp;diff=148</id>
		<title>User:Belmonte</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=User:Belmonte&amp;diff=148"/>
				<updated>2007-12-23T18:16:08Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: New page: The founder of the Autism Collaborative&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The founder of the Autism Collaborative&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=User:Zinsser&amp;diff=147</id>
		<title>User:Zinsser</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=User:Zinsser&amp;diff=147"/>
				<updated>2007-12-23T18:15:36Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: New page: A Developer in the Autism Collaborative&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A Developer in the Autism Collaborative&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=146</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=146"/>
				<updated>2007-12-23T18:03:52Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Submit a Bug or Other Issue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask a developer for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use XNA.Framework.GameTime.ElapsedGameTime as tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Display a Static Image==&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a programmer will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = cm.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content\MiniGames\MyImage&amp;quot;);     // Source image with no file extension&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Display an Animation==&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) because tAC_Engine does a lot of caching and logging behind the scenes. Instead get keyboard input like this:&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.Left))&lt;br /&gt;
 {&lt;br /&gt;
   // The left key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If an exception is thrown stating &amp;quot;Unregistered Key Comparison&amp;quot; then add that key to the list in the InputState constructor.&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Not yet implemented.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=145</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=145"/>
				<updated>2007-12-23T17:59:03Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Submit a Bug or Other Issue */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Developers sign in with the email address &amp;quot;collaborators@autismcollaborative.org&amp;quot;&lt;br /&gt;
** Ask August for the password&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use XNA.Framework.GameTime.ElapsedGameTime as tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Display a Static Image==&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a programmer will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = cm.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content\MiniGames\MyImage&amp;quot;);     // Source image with no file extension&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Display an Animation==&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) because tAC_Engine does a lot of caching and logging behind the scenes. Instead get keyboard input like this:&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.Left))&lt;br /&gt;
 {&lt;br /&gt;
   // The left key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If an exception is thrown stating &amp;quot;Unregistered Key Comparison&amp;quot; then add that key to the list in the InputState constructor.&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Not yet implemented.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=144</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=144"/>
				<updated>2007-12-05T23:48:47Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Import a new Sound */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Email August for a new user if necessary&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use XNA.Framework.GameTime.ElapsedGameTime as tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Display a Static Image==&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a programmer will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = cm.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content\MiniGames\MyImage&amp;quot;);     // Source image with no file extension&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Display an Animation==&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) because tAC_Engine does a lot of caching and logging behind the scenes. Instead get keyboard input like this:&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.Left))&lt;br /&gt;
 {&lt;br /&gt;
   // The left key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If an exception is thrown stating &amp;quot;Unregistered Key Comparison&amp;quot; then add that key to the list in the InputState constructor.&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Not yet implemented.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (Autism Collaborative\Game\Game\Content\Sounds\MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=143</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=143"/>
				<updated>2007-12-05T22:49:12Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Import and Play a Sound */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Email August for a new user if necessary&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use XNA.Framework.GameTime.ElapsedGameTime as tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Display a Static Image==&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a programmer will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = cm.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content\MiniGames\MyImage&amp;quot;);     // Source image with no file extension&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Display an Animation==&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) because tAC_Engine does a lot of caching and logging behind the scenes. Instead get keyboard input like this:&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.Left))&lt;br /&gt;
 {&lt;br /&gt;
   // The left key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If an exception is thrown stating &amp;quot;Unregistered Key Comparison&amp;quot; then add that key to the list in the InputState constructor.&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Not yet implemented.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Use Sound==&lt;br /&gt;
&lt;br /&gt;
===Import a new Sound===&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
&lt;br /&gt;
===Play a Sound===&lt;br /&gt;
&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	<entry>
		<id>https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=142</id>
		<title>Code How To&#039;s</title>
		<link rel="alternate" type="text/html" href="https://www.autismcollaborative.org/wiki/index.php?title=Code_How_To%27s&amp;diff=142"/>
				<updated>2007-12-04T01:30:33Z</updated>
		
		<summary type="html">&lt;p&gt;Zinsser: /* Use the Game Script */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides tutorials for some of the most common actions a programmer may wish to implement. It may helpful to read the [[Code Overview]] first.&lt;br /&gt;
&lt;br /&gt;
==Submit a Bug or Other Issue==&lt;br /&gt;
&lt;br /&gt;
* Login to BugHost.com&lt;br /&gt;
** Email August for a new user if necessary&lt;br /&gt;
* Click the Submit button on the top navigation bar&lt;br /&gt;
* Fill out the fields that apply to this issue&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type of Bug:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Functional Problem&lt;br /&gt;
** Any actual &amp;quot;Bug&amp;quot;&lt;br /&gt;
* Suggestion&lt;br /&gt;
** A possible change to the game that may improve it&lt;br /&gt;
* New Feature&lt;br /&gt;
** Something that &amp;#039;&amp;#039;&amp;#039;absolutely must&amp;#039;&amp;#039;&amp;#039; be implemented&lt;br /&gt;
** Use sparingly; make sure it&amp;#039;s not actually a Suggestion&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Severity:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How much this issue affects the game/application&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Priority:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* How soon the issue should be resolved (relative to other issues)&lt;br /&gt;
* The majority of issues should be Low priority&lt;br /&gt;
* Use High sparingly&lt;br /&gt;
&lt;br /&gt;
==Coding Conventions==&lt;br /&gt;
&lt;br /&gt;
* Place the name of the file, authors, and copyright info at the top of each file&lt;br /&gt;
** Any person who makes significant changes to a file should add their name to the list of authors in a file&lt;br /&gt;
*** This helps anyone reading the code because they know who to ask if they have a question about something&lt;br /&gt;
* All private and protected class member variables are lowerCamelCase&lt;br /&gt;
* Private/protected class member variables are preceded with &amp;quot;m&amp;quot; (ie mLocalVariable)&lt;br /&gt;
* All functions, properties (sometimes called &amp;quot;smart fields&amp;quot;), and public class variables are UpperCamelCase&lt;br /&gt;
* Public variables should only be used with small classes that are only used by one or two other classes&lt;br /&gt;
* This code is intended to be viewed by many people who do not have strong programming backgrounds, therefore documentation is &amp;#039;&amp;#039;&amp;#039;very&amp;#039;&amp;#039;&amp;#039; important&lt;br /&gt;
** Document the purpose of each class&amp;#039;s member variables, either next to their declaration or as a summary for their property accessor&lt;br /&gt;
** Create a summary documentation block for every function unless it is extremely obvious&lt;br /&gt;
*** This can be done by placing the cursor above a function definition and typing &amp;quot;///&amp;quot;&lt;br /&gt;
*** This block shows up in Intellisense when writing that function in code&lt;br /&gt;
** Add a summary to any properties that are possibly confusing or not straightforward &lt;br /&gt;
** Document every step of each algorithm (except for very obvious function calls like ResetSettings();)&lt;br /&gt;
*** Someone should be able to read only the comments in a function and still understand what it does&lt;br /&gt;
** See MeteorMadness.cs for an example of the appropriate level of documentation&lt;br /&gt;
&lt;br /&gt;
==Create a New Minigame==&lt;br /&gt;
&lt;br /&gt;
* Declare the class&lt;br /&gt;
** Create a new folder under ColonySimulator&lt;br /&gt;
** Create a new file in that folder named NewMinigame.cs where NewGame is the name of the new minigame&lt;br /&gt;
** Place all new minigame-specific classes in that folder&lt;br /&gt;
** Have the class derive from MiniGame &lt;br /&gt;
 class NewGame : MiniGame {...}&lt;br /&gt;
* Implement the Constructor&lt;br /&gt;
** Initialize game variables&lt;br /&gt;
** Declare a ScoreCard (see Scoring tutorial)&lt;br /&gt;
** Log the GameBegin code (see the Logging tutorial)&lt;br /&gt;
* Implement Update()&lt;br /&gt;
 public override void Update(ContentManager content){...}&lt;br /&gt;
** Do not assume a constant call rate&lt;br /&gt;
*** This function will almost always be called 60 times per second, but that rate may vary depending on CPU load&lt;br /&gt;
*** At the beginning of each cycle, get the time since the last cycle like this:&lt;br /&gt;
**** float dt = ColonyBaseApplication.GameManager.ElapsedSeconds;&lt;br /&gt;
**** &amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use XNA.Framework.GameTime.ElapsedGameTime as tAC_Engine implements update timing differently than a standard XNA application!&lt;br /&gt;
*** Build the time into all movement and timers, for example:&lt;br /&gt;
 myEntity.LifeSpan -= dt;&lt;br /&gt;
 myEntity.Position += myEntity.Velocity * dt;&lt;br /&gt;
* Implement Draw()&lt;br /&gt;
 public override void Draw(SpriteBatch spriteBatch){...}&lt;br /&gt;
** Loop through all the game&amp;#039;s entities and call their Draw() functions&lt;br /&gt;
** Consider using a generalized render-queue such as GenericWorldSpace &amp;#039;&amp;#039;&amp;#039;(not-yet-implemented as of Oct 2007)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Create a new game mode&lt;br /&gt;
** Add a new entry to ColonyBaseApplication.Modes = { ModeSelector, ColonySim, ...}&lt;br /&gt;
** Add the appropriate case to ColonyBaseApplication.SwitchMode(...)&lt;br /&gt;
** Add a new MiniGameInfo entry to ModeSelector.ModeSelector()&lt;br /&gt;
* End the game&lt;br /&gt;
** Flush the particle system (see the particles tutorial) if any emitters were created&lt;br /&gt;
** Log the GameEndSuccess/GameEndFailure code&lt;br /&gt;
** Flush the log (forces it to write any cached codes to disk)&lt;br /&gt;
** Show the score&lt;br /&gt;
** Switch the mode to ColonySim&lt;br /&gt;
 ColonyBaseApplication.SwitchMode(ColonyBaseApplication.Modes.ColonySim);&lt;br /&gt;
&lt;br /&gt;
==Display a Static Image==&lt;br /&gt;
&lt;br /&gt;
Before manually drawing something to screen consider using some type of game object, be it an Entity, HUD element, or even a Ticker (see the tutorials below). Game objects all know how to draw themselves, so it is unlikely that a programmer will need to draw something directly to the screen. Should the need arise, however, here&amp;#039;s how it&amp;#039;s done:&lt;br /&gt;
&lt;br /&gt;
* Import the content into the project&lt;br /&gt;
** Browse to the appropriate folder in Visual Studio&amp;#039;s Solution Explorer&lt;br /&gt;
*** For example, Content\MiniGames\MyImage.png&lt;br /&gt;
** Right click on that folder and select Add-&amp;gt;Existing Item&lt;br /&gt;
** Select the image to import&lt;br /&gt;
* Load it in code:&lt;br /&gt;
 GraphicsDeviceManager gdm = ...;    // This is declared in GenericGameManager.cs&lt;br /&gt;
 ConentManager cm = ...;             // Usually a parameter, as in Update(ContentManager content)&lt;br /&gt;
 SpriteBatch sb = new SpriteBatch(gdm.GraphicsDevice);                     // Basically a wrapper for a DirectX render target&lt;br /&gt;
 Texture2D texture = cm.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content\MiniGames\MyImage&amp;quot;);     // Source image with no file extension&lt;br /&gt;
 Rectangle destination = ...;        // Display destination&lt;br /&gt;
 Color tint = Color.White;           // Tint the image with this color&lt;br /&gt;
 float rotation = 0f;                // Rotation (in radians)&lt;br /&gt;
 Vector2 center = new Vector2(texture.Width / 2f, texture.Height / 2f);         // Origin of rotation&lt;br /&gt;
 float zDepth = 1f;                  // Order to draw sprites within this spritebatch&lt;br /&gt;
 &lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.BackToFront, SaveStateMode.SaveState);&lt;br /&gt;
 &lt;br /&gt;
 sb.Draw(&lt;br /&gt;
   texture,&lt;br /&gt;
   destination ,&lt;br /&gt;
   null,               // What part of the source image to sample from--null tells it to use the whole image&lt;br /&gt;
   tint ,&lt;br /&gt;
   rotation,&lt;br /&gt;
   center,&lt;br /&gt;
   SpriteEffects.None, // How to mirror the image&lt;br /&gt;
   zDepth &lt;br /&gt;
 );&lt;br /&gt;
 &lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Display an Animation==&lt;br /&gt;
&lt;br /&gt;
Animations are built into Entities. There are no plans to support animation in any other context. Here&amp;#039;s an example:&lt;br /&gt;
&lt;br /&gt;
 Animation anim = new Animation(new Vector2(100, 100));  // Create an animation that is 100x100 pixels when displayed&lt;br /&gt;
 anim.AddClip(&amp;quot;Idle&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/IdleSpriteSheet&amp;quot;), 5, 1f/60f);       // a 500x100 spritesheet&lt;br /&gt;
 anim.AddClip(&amp;quot;Walk&amp;quot;, content.Load&amp;lt;Texture2D&amp;gt;(@&amp;quot;Content/WalkSpriteSheet&amp;quot;), 12, 1f / 60f);    // a 400x300 spritesheet&lt;br /&gt;
 Entity ent = new Entity(anim, new Vector3(10f, 50f, 0f), new Vector3(100f, 100f, 0f));      // a 100x100 2D entity located at (10,50)&lt;br /&gt;
 &lt;br /&gt;
 ent.Play(&amp;quot;Idle&amp;quot;);       // Start the idle animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Play(&amp;quot;Walk&amp;quot;);       // Switch to the walking animation&lt;br /&gt;
 // ...&lt;br /&gt;
 ent.Draw(sb);           // Draw to the SpriteBatch sb&lt;br /&gt;
&lt;br /&gt;
==Create a New Type of Game Object==&lt;br /&gt;
&lt;br /&gt;
All specific game objects (players, enemies, collectibles, projectiles, etc.) should derive from Entity. This gives them easy ways to draw themselves, move, collide with other entities, and be passed to many tAC_Engine functions.&lt;br /&gt;
&lt;br /&gt;
==Get User Input==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;DO NOT&amp;#039;&amp;#039;&amp;#039; use the standard XNA keyboard accessors (Xna.Framework.Input.KeyboardState or Xna.Framework.Input.Keyboard) because tAC_Engine does a lot of caching and logging behind the scenes. Instead get keyboard input like this:&lt;br /&gt;
&lt;br /&gt;
 if (InputState.IsKeyDown(Keys.Left))&lt;br /&gt;
 {&lt;br /&gt;
   // The left key was pressed&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If an exception is thrown stating &amp;quot;Unregistered Key Comparison&amp;quot; then add that key to the list in the InputState constructor.&lt;br /&gt;
&lt;br /&gt;
==Manage a Heads Up Display==&lt;br /&gt;
&lt;br /&gt;
Not yet implemented.&lt;br /&gt;
&lt;br /&gt;
==Display Text or Icons with the Ticker==&lt;br /&gt;
&lt;br /&gt;
 string text = &amp;quot;w00t.&amp;quot;;                      // Text to display (can be &amp;quot;&amp;quot;)&lt;br /&gt;
 Texture2D image = null;                     // Can also be set to an image&lt;br /&gt;
 Vector2 imageSize = new Vector2(25f, 25f);  // Size of the (optional) icon&lt;br /&gt;
 Vector2 offset = new Vector2(700f, 50f);    // This will display the ticker 700 pixels to the right of the screen&amp;#039;s &lt;br /&gt;
                                             //   center and 50 pixels below the screen&amp;#039;s center&lt;br /&gt;
 Vector2 velocity = new Vector2 (-10f, 0f);  // Move left 10 pixels per second&lt;br /&gt;
 Ticker.Font font = Ticker.Font.Standard;    // Regular text&lt;br /&gt;
 Color color = Color.DeepPink;               // The manliest of colors&lt;br /&gt;
 float opacity = .5f;                        // 50% transparent&lt;br /&gt;
 float seconds = 5f;                         // Disappear after 5 seconds&lt;br /&gt;
 bool fade = true;                           // Fade in and fade out&lt;br /&gt;
 &lt;br /&gt;
 Ticker.Display(text, image, imageSize, offset, velocity, font, color, opacity, seconds, fade);&lt;br /&gt;
&lt;br /&gt;
==Display Text Manually==&lt;br /&gt;
&lt;br /&gt;
Most text displayed should be done using the Ticker, but if you really want to display text manually use the Nuclex font library (XNA now supports text, so the Nuclex library may eventually be removed). First you must import the desired font:&lt;br /&gt;
&lt;br /&gt;
* Create an xml file for the new font called FontName.tffimport that looks like this:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;TrueTypeImport&amp;gt;&lt;br /&gt;
   &amp;lt;Path&amp;gt;Content\Fonts\MercuryII.ttf&amp;lt;/Path&amp;gt;&lt;br /&gt;
   &amp;lt;Size&amp;gt;32&amp;lt;/Size&amp;gt;&lt;br /&gt;
 &amp;lt;/TrueTypeImport&amp;gt;&lt;br /&gt;
* Put the font (FontName.ttf) and FontName.tffimport in the Content\Fonts directory&lt;br /&gt;
* Set the following properties for FontName.ttf&lt;br /&gt;
** Build Action: None&lt;br /&gt;
** Copy to Output Directory: Copy if newer&lt;br /&gt;
** File Name: MercuryII.ttf&lt;br /&gt;
* Set the following properties for FontName.tffimport&lt;br /&gt;
** Build Action: Content&lt;br /&gt;
** Content Importer: TrueTypeFont - XNA Framework&lt;br /&gt;
** Content Processor: Bitmap Font - XNA Framework&lt;br /&gt;
** Copy to Output Directory: Do not copy&lt;br /&gt;
** XNA Framework Content: True&lt;br /&gt;
&lt;br /&gt;
Now for the code:&lt;br /&gt;
&lt;br /&gt;
 ContentManager cm = ...;&lt;br /&gt;
 SpriteBatch sb = ...;&lt;br /&gt;
 BitmapFont bmf = cm.Load&amp;lt;BitmapFont&amp;gt;(@&amp;quot;Content\Fonts\Arial&amp;quot;);&lt;br /&gt;
 sb.Begin(SpriteBlendMode.AlphaBlend);&lt;br /&gt;
 bmf.DrawString(new Vector2(10.0F, 10.0F), &amp;quot;Manual Text!&amp;quot;, Color.Azure);&lt;br /&gt;
 sb.End();&lt;br /&gt;
&lt;br /&gt;
==Import and Play a Sound==&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\XACT\Xact.exe&lt;br /&gt;
** This is the XACT tool from Microsoft DirectX SDK August 2006&lt;br /&gt;
** If--after following the steps in this tutorial--playing a file in code throws an exception about using the wrong version of XACT, try using Xact.exe from a different SDK build&lt;br /&gt;
* Open Autism Collaborative\Game\Game\Content\Sounds\AudioProject.xap&lt;br /&gt;
* Expand Wave Banks and double click Wave Bank in the panel on the left&lt;br /&gt;
* Expand Sound Banks and double click Sound Bank in the panel on the left&lt;br /&gt;
* Go to Wave Banks-&amp;gt;Insert Wave File(s)...&lt;br /&gt;
* Select the file to import (MySound.wav) and click OK&lt;br /&gt;
* Drag the newly-added file to the Cue Name section in the Sound Bank:Sound Bank window&lt;br /&gt;
* Go to File-&amp;gt;Build&lt;br /&gt;
* Save and close XACT&lt;br /&gt;
* Open game.sln with Visual Studio&lt;br /&gt;
* Browse to the Content\Sounds folder in the Solution Explorer&lt;br /&gt;
* Right click the Sounds folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MySound.wav and click OK&lt;br /&gt;
* To play this new sound, use the following code:&lt;br /&gt;
 Sound.Play(&amp;quot;MySound&amp;quot;); // No file extension&lt;br /&gt;
&lt;br /&gt;
==Use the Particle Engine==&lt;br /&gt;
&lt;br /&gt;
Particles are handled by Sparx, a subset of the Pina library being developed alongside the Autism Game. Features are added to it on an as-needed basis so if a new feature &amp;#039;&amp;#039;&amp;#039;is&amp;#039;&amp;#039;&amp;#039; needed contact August or email support.&lt;br /&gt;
&lt;br /&gt;
Particle Effects are imported via the content pipeline, so they can be called in a similar manner:&lt;br /&gt;
&lt;br /&gt;
 using Pina3D.Particles;&lt;br /&gt;
 &lt;br /&gt;
 ...&lt;br /&gt;
 &lt;br /&gt;
 Emitter mRootEmitter;&lt;br /&gt;
 mRootEmitter = Sparx.LoadParticleEffect(@&amp;quot;Content\Particle Effects\MyParticleEffect.spx&amp;quot;);&lt;br /&gt;
 Sparx.AddEmitter(mRootEmitter);&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to kill emitters when they are no longer needed.&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Alive = false;  // Kills the Emitter&lt;br /&gt;
 Sparx.Flush();               // Kills all Emitters&lt;br /&gt;
&lt;br /&gt;
Emitters can be moved around:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.Position2D = new Vector2(100f, 100f);  // Emitter will move, but existing Particles will not be affected&lt;br /&gt;
&lt;br /&gt;
They can also move and keep their Particles in the same relative location.&lt;br /&gt;
&lt;br /&gt;
 // COMING SOON (this old code does not yet work with the new 3D particle system&lt;br /&gt;
 //mRootEmitter.Transform = Matrix.CreateTranslation(100f, 100f, 0); // Particles will move with the Emitter&lt;br /&gt;
&lt;br /&gt;
Any aspect of a Particle Effect can be changed at runtime. For example, to make an effect green add a Modifier:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.RegularEmissionType.Modifiers.Add(new Modifier(&amp;quot;whateverMyNameIs&amp;quot;, 0f, 0f, Color.Green, Color.Green, 1f, 1f, 1f, 1f, 0f, 0f));&lt;br /&gt;
&lt;br /&gt;
Or apply forces at runtime:&lt;br /&gt;
&lt;br /&gt;
 mRootEmitter.SubscribeEmissionsToForce(new Current(&amp;quot;theWind&amp;quot;, 0f, 0f, new Vector3(10f, 0f, 0f), 1f));&lt;br /&gt;
&lt;br /&gt;
===Create a New Particle Effect===&lt;br /&gt;
&lt;br /&gt;
This can be done entirely at runtime, however it is usually much easier (and more fun) to use they WYSIWYG editor SparxCreator3D. Please report any bugs to August or submit them to the bug database.&lt;br /&gt;
&lt;br /&gt;
* Run Autism Collaborative\Utilities\SparxCreator3D.exe&lt;br /&gt;
* Make an effect&lt;br /&gt;
** Emitters can emit Emissions&lt;br /&gt;
** Emissions can be Particles or Emitters&lt;br /&gt;
** Modifiers can be applied to Emissions&lt;br /&gt;
** Forces can be applied to Emitters&lt;br /&gt;
&lt;br /&gt;
Once an effect file is generated (MyEffect.spx) import it into the game to use it.&lt;br /&gt;
&lt;br /&gt;
* In the Solution Explorer, browse to Content\Particle Effects&lt;br /&gt;
* Right click the folder and select Add-&amp;gt;Existing Item...&lt;br /&gt;
* Select MyEffect.spx and click OK&lt;br /&gt;
* Change MyEffect.spx&amp;#039;s Copy to Output Directory property to Copy Always&lt;br /&gt;
&lt;br /&gt;
==Keep Score and Give Resources to the Simulator Mode==&lt;br /&gt;
&lt;br /&gt;
Use the ScoreCard class to keep track of the score from a minigame. It provides easy ways to add and subtract resources, as well as an easy way to display them and pass them along to the Colony Simulator.&lt;br /&gt;
&lt;br /&gt;
MiniGame has a ColonyScoreCard built into it, accessible by the Score property. Here are some examples of how to use it:&lt;br /&gt;
&lt;br /&gt;
 class MyGame : MiniGame&lt;br /&gt;
 {&lt;br /&gt;
   public override void Update(ContentManager content)&lt;br /&gt;
   {&lt;br /&gt;
     Score.Gather(ColonyResources.Money, 500);    // Get 500 Monies&lt;br /&gt;
     &lt;br /&gt;
     MyGameObject mgo = new MyGameObject();&lt;br /&gt;
     mgo.GiveMyGameCarbon();                      // Get 1 Carbon&lt;br /&gt;
 &lt;br /&gt;
     Score.IncurDamageCost(100);                  // On CashOut, Money = Max (Money - DamageCosts, 0)&lt;br /&gt;
 &lt;br /&gt;
     int HowMuchMoneyIHave = Score.QueryResource(ColonyResources.Money);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   public void DisplayTheScore()&lt;br /&gt;
   {&lt;br /&gt;
     bool playerWonTheMinigame = true;            // Can be set to false if the player lost&lt;br /&gt;
     Score.Display(playerWonTheMinigame );        // Displays a copy of the current score and a message for succses/failure&lt;br /&gt;
     Score.CashOut();                             // Transfers resources from MyGame to the Colony Simulator&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   // ...&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 class MyGameObject : Entity&lt;br /&gt;
 {&lt;br /&gt;
   public void GiveMyGameCarbon()&lt;br /&gt;
   {&lt;br /&gt;
     ColonyBaseApplication.MiniGame.Score.Gather(ColonyResources.Carbon, 1);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Write to the Experimental Log==&lt;br /&gt;
&lt;br /&gt;
As the game runs, certain actions are recorded and written to a file (Autism Collaborative\Game\Game\bin\x86\Debug\ExperimentalLog.txt or the corresponding Release folder). In the lab, these codes are also sent through the parallel port to sync the EEG data. Every action that pertains to an experiment must be logged in order to be analyzed (that&amp;#039;s kind of the whole point of this game!).&lt;br /&gt;
&lt;br /&gt;
First define the necessary game codes.&lt;br /&gt;
&lt;br /&gt;
* Open Logger.cs&lt;br /&gt;
* Add up to 253 codes to public enum ExperimentalCode&lt;br /&gt;
** All codes must start with a unique &amp;quot;code identifier&amp;quot;, an underscore, and then a descriptor in UpperCamelCase&lt;br /&gt;
*** For minigames, the code identifier is 2 letters&lt;br /&gt;
** 3 codes are reserved for special parallel port functions with the software that runs the EEG machines used in lab tests&lt;br /&gt;
&lt;br /&gt;
Now those codes are available for logging. Like so:&lt;br /&gt;
&lt;br /&gt;
 Logger.LogCode(Logger.ExperimentalCode.XX_Descriptor);&lt;br /&gt;
&lt;br /&gt;
It is also possible to tell the logger to log a code every time a specific key is pressed:&lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down, Logger.ExperimentalCode.DEBUG_DudeJustPushedA);&lt;br /&gt;
&lt;br /&gt;
Each minigame should remove the encodings when it is done, but it is also a good idea to decode the keys at the start of each minigame just in case. &lt;br /&gt;
&lt;br /&gt;
 InputState.Encode(Keys.A, InputState.KeyState.Down);&lt;br /&gt;
 InputState.DecodeAll();&lt;br /&gt;
&lt;br /&gt;
Every minigame should also start with its GameBegin and end with its GameEnd[Success/Failure] codes.&lt;br /&gt;
&lt;br /&gt;
It may be helpful to log events for debugging purposes. These codes have the identifier &amp;quot;DEBUG&amp;quot; and will not be logged unless the game is running in Debug mode. All new DEBUG tags must be explicitly assigned a value less than 0.&lt;br /&gt;
&lt;br /&gt;
==Use the Game Script==&lt;br /&gt;
&lt;br /&gt;
The tAC_Engine houses a [[http://www.lua.org/ Lua]] Virtual Machine. This can be used to tweak global parameters at runtime, load them from config files, drive cutscenes, or even save and load levels.&lt;br /&gt;
&lt;br /&gt;
Function callbacks are defined in C# and then invoked from a Lua file or the in-game Debug console. In other words, C# tells Lua &amp;quot;you may use these functions: X,Y,...&amp;quot; and then Lua says &amp;quot;do X, do Y, etc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Here are a couple of ways to leverage this system:&lt;br /&gt;
&lt;br /&gt;
===Make a Cutscene===&lt;br /&gt;
&lt;br /&gt;
* Create a new lua file in the Scripts directory&lt;br /&gt;
** That file can call any registered function callbacks&lt;br /&gt;
* In the Properties window, set Copy to Output Directory to Copy if Newer&lt;br /&gt;
* Call that cutscene with:&lt;br /&gt;
 GenericBaseApplication.GameManager.PlayCutscene(@&amp;quot;Scripts\MyCutscene.lua&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
===To Register a Function Callback===&lt;br /&gt;
&lt;br /&gt;
* Create the function in C# (if the function does not already exist)&lt;br /&gt;
** It must be declared public and non-static&lt;br /&gt;
** If the need arises to register a static function, declare an instanced function in GenericLuaHelper or ColonyLuaHelper that simply calls the static function.&lt;br /&gt;
* Register the function with the Lua Virtual Machine&lt;br /&gt;
** Add the special LuaCallback annotation to the function&lt;br /&gt;
* Call the RegisterLuaCallbacks function in the class&amp;#039;s constructor that contains the function.&lt;br /&gt;
* Example:&lt;br /&gt;
 public MyClass()&lt;br /&gt;
 {  // Constructor&lt;br /&gt;
   LuaHelper.RegisterLuaCallbacks(this);&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 [LuaCallback(&amp;quot;SetMyVariable&amp;quot;)]&lt;br /&gt;
 public int SetMyVariable(int value)&lt;br /&gt;
 {&lt;br /&gt;
   mMyVariable = value;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
===Tweak Game Parameters===&lt;br /&gt;
&lt;br /&gt;
Exposing a variable to the Lua Virtual Machine allows it to be accessed by a any script (including config files) or changed at runtime in the drop down console (accessible in Debug mode by hitting &amp;quot;~&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
* Expose a variable with a global setter/getter with a LuaCallback annotation&lt;br /&gt;
** Make sure to call the RegisterLuaCallbacks function in that class&amp;#039;s constructor if the getter/setter is not in the Game Manager&lt;br /&gt;
* Set the default value for the variable in the config file (optional)&lt;br /&gt;
** There are 3 config files for the 3 configurations of the game builds&lt;br /&gt;
*** Debug.conf, for development&lt;br /&gt;
*** StandardRelease.conf, for public releases of the game&lt;br /&gt;
*** LabRelease.conf, for use in the lab&lt;br /&gt;
&lt;br /&gt;
===Create Local Settings===&lt;br /&gt;
&lt;br /&gt;
Programmers may want to change certain properties on their machines without affecting the source-controlled code. They could change the resolution, sound settings, or even have the game bypass the regular startup sequence and launch right into the middle of a MiniGame all with no effect on other developers.&lt;br /&gt;
&lt;br /&gt;
* Create a new file: Autism Collaborative\Game\Game\Scripts\LocalSettings.lua&lt;br /&gt;
** The Visual Studio project already has this file included, but VS won&amp;#039;t be able to edit it until the file is created manually&lt;br /&gt;
* Add Lua commands and save the file&lt;br /&gt;
** Visual Studio can now be used to edit the file&lt;br /&gt;
* The file is run at the end of the Debug.conf script (if it exists)&lt;br /&gt;
** That means that this script is only run in Debug mode&lt;br /&gt;
* do &amp;#039;&amp;#039;&amp;#039;NOT&amp;#039;&amp;#039;&amp;#039; add LocalSettings.lua to source control!&lt;br /&gt;
&lt;br /&gt;
==Run the Game in the Lab==&lt;br /&gt;
&lt;br /&gt;
To enable the features necessary to run the game in the lab, the file conlab.tac must exist next to the game&amp;#039;s executable.&lt;br /&gt;
&lt;br /&gt;
From visual studio:&lt;br /&gt;
* Change the configuration to &amp;quot;ReleaseLab&amp;quot;&lt;br /&gt;
* Build the solution&lt;br /&gt;
From a public release of the game:&lt;br /&gt;
* Find &amp;quot;constd.tac,&amp;quot; the standard encrypted config file&lt;br /&gt;
* Copy &amp;quot;conlab.tac&amp;quot; to the same directory&lt;br /&gt;
** Autism Collaborative\Game\Game\bin\x86\Laboratory\conlab.tac is generated when the game is compiled&lt;br /&gt;
** If the game finds conlab, it assumes it is in the lab and uses that config file&lt;br /&gt;
** If conlab is not present, it assumes it is not in the lab and uses constd.tac as the config file&lt;/div&gt;</summary>
		<author><name>Zinsser</name></author>	</entry>

	</feed>