Commits

Carolyn Van Slyck committed 1fb3011

* Silverlight project created, linked and building
* Added New Game option to the start screen, not hooked up yet.

Comments (0)

Files changed (17)

Lib/FarseerPhysics.dll

Binary file added.

Lib/SilverArcade.SilverSprite.Core.Phone.dll

Binary file added.

Lib/SilverArcade.SilverSprite.Core.dll

Binary file added.

Lib/SilverArcade.SilverSprite.dll

Binary file added.
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OMG.Xbox", "OMG\OMG.Xbox.csproj", "{7D7B175C-E7C8-48A4-A929-82B1563C1C51}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OMG.Silverlight", "OMG\OMG.Silverlight.csproj", "{007BFB19-7783-4510-AD91-3C40974C9A8D}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		{7D7B175C-E7C8-48A4-A929-82B1563C1C51}.Release|Xbox 360.ActiveCfg = Release|Xbox 360
 		{7D7B175C-E7C8-48A4-A929-82B1563C1C51}.Release|Xbox 360.Build.0 = Release|Xbox 360
 		{7D7B175C-E7C8-48A4-A929-82B1563C1C51}.Release|Xbox 360.Deploy.0 = Release|Xbox 360
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Debug|Xbox 360.ActiveCfg = Debug|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Release|Any CPU.Build.0 = Release|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Release|x86.ActiveCfg = Release|Any CPU
+		{007BFB19-7783-4510-AD91-3C40974C9A8D}.Release|Xbox 360.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
+<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
+             x:Class="OMG.Silverlight.App"
+             >
+    <Application.Resources>
+        
+    </Application.Resources>
+</Application>
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace OMG.Silverlight
+{
+    public partial class App : Application
+    {
+
+        public App()
+        {
+            this.Startup += this.Application_Startup;
+            this.Exit += this.Application_Exit;
+            this.UnhandledException += this.Application_UnhandledException;
+
+            InitializeComponent();
+        }
+
+        private void Application_Startup(object sender, StartupEventArgs e)
+        {
+            this.RootVisual = new MainPage();
+        }
+
+        private void Application_Exit(object sender, EventArgs e)
+        {
+
+        }
+
+        private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
+        {
+            // If the app is running outside of the debugger then report the exception using
+            // the browser's exception mechanism. On IE this will display it a yellow alert 
+            // icon in the status bar and Firefox will display a script error.
+            if (!System.Diagnostics.Debugger.IsAttached)
+            {
+
+                // NOTE: This will allow the application to continue running after an exception has been thrown
+                // but not handled. 
+                // For production applications this error handling should be replaced with something that will 
+                // report the error to the website and stop the application.
+                e.Handled = true;
+                Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
+            }
+        }
+
+        private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
+        {
+            try
+            {
+                string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
+                errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
+
+                System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
+            }
+            catch (Exception)
+            {
+            }
+        }
+    }
+}

OMG/CharacterCreatorGame.cs

+using OMG.MiniGame;
+using OMG.Sprite;
+
+namespace OMG
+{
+    public class CharacterCreatorGame : MiniGameBase
+    {
+        private Cursor _cursor;
+
+        protected override void InitializeSprites()
+        {
+            _cursor = new Cursor();
+            Sprites.Add(_cursor);
+        }
+    }
+}

OMG/MainPage.xaml

+<UserControl x:Class="OMG.Silverlight.MainPage"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
+    Width="400" Height="300">
+    <Grid x:Name="LayoutRoot" Background="White">
+        <Canvas>
+
+        </Canvas>
+    </Grid>
+</UserControl>

OMG/MainPage.xaml.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Animation;
+using System.Windows.Shapes;
+
+namespace OMG.Silverlight
+{
+    public partial class MainPage : UserControl
+    {
+        public MainPage()
+        {
+            InitializeComponent();
+        }
+    }
+}

OMG/MiniGame/MiniGameBase.cs

 using Microsoft.Xna.Framework;
 using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
 using OMG.GameController;
 using OMG.Sprite;
 

OMG/OMG.Silverlight.csproj

+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>8.0.50727</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{007BFB19-7783-4510-AD91-3C40974C9A8D}</ProjectGuid>
+    <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>OMG</RootNamespace>
+    <AssemblyName>OMG.Silverlight</AssemblyName>
+    <TargetFrameworkIdentifier>Silverlight</TargetFrameworkIdentifier>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <SilverlightVersion>$(TargetFrameworkVersion)</SilverlightVersion>
+    <SilverlightApplication>true</SilverlightApplication>
+    <SupportedCultures>
+    </SupportedCultures>
+    <XapOutputs>true</XapOutputs>
+    <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
+    <XapFilename>OMG.Silverlight.xap</XapFilename>
+    <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
+    <SilverlightAppEntry>OMG.Silverlight.App</SilverlightAppEntry>
+    <TestPageFileName>OMG.SilverlightTestPage.html</TestPageFileName>
+    <CreateTestPage>true</CreateTestPage>
+    <ValidateXaml>true</ValidateXaml>
+    <EnableOutOfBrowser>false</EnableOutOfBrowser>
+    <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
+    <UsePlatformExtensions>false</UsePlatformExtensions>
+    <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
+    <LinkedServerProject>
+    </LinkedServerProject>
+  </PropertyGroup>
+  <!-- This property group is only here to support building this project using the 
+       MSBuild 3.5 toolset. In order to work correctly with this older toolset, it needs 
+       to set the TargetFrameworkVersion to v3.5 -->
+  <PropertyGroup Condition="'$(MSBuildToolsVersion)' == '3.5'">
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>Bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
+    <NoStdLib>true</NoStdLib>
+    <NoConfig>true</NoConfig>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>Bin\Release</OutputPath>
+    <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
+    <NoStdLib>true</NoStdLib>
+    <NoConfig>true</NoConfig>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="FarseerPhysics">
+      <HintPath>..\Lib\FarseerPhysics.dll</HintPath>
+    </Reference>
+    <Reference Include="mscorlib" />
+    <Reference Include="SilverArcade.SilverSprite">
+      <HintPath>..\Lib\SilverArcade.SilverSprite.dll</HintPath>
+    </Reference>
+    <Reference Include="SilverArcade.SilverSprite.Core">
+      <HintPath>..\Lib\SilverArcade.SilverSprite.Core.dll</HintPath>
+    </Reference>
+    <Reference Include="SilverArcade.SilverSprite.Core.Phone">
+      <HintPath>..\Lib\SilverArcade.SilverSprite.Core.Phone.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Windows" />
+    <Reference Include="system" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Net" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Windows.Browser" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="App.xaml.cs">
+      <DependentUpon>App.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="CharacterCreatorGame.cs" />
+    <Compile Include="GameController\GameControllerAction.cs" />
+    <Compile Include="GameController\GameControllerState.cs" />
+    <Compile Include="GameController\KeyboardController.cs" />
+    <Compile Include="GameController\MouseAction.cs" />
+    <Compile Include="GameController\MouseController.cs" />
+    <Compile Include="GameController\XboxController.cs" />
+    <Compile Include="GameController\XboxControllerAction.cs" />
+    <Compile Include="GameCursor.cs" />
+    <Compile Include="GameFont.cs" />
+    <Compile Include="GameScreen.cs" />
+    <Compile Include="MainPage.xaml.cs">
+      <DependentUpon>MainPage.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="MiniGame\AgilityCourse\AgilityCourseGame.cs" />
+    <Compile Include="MiniGame\IMiniGame.cs" />
+    <Compile Include="MiniGame\MiniGameBase.cs" />
+    <Compile Include="MiniGame\MiniGameManager.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Sprite\Cursor.cs" />
+    <Compile Include="Sprite\DialogOption.cs" />
+    <Compile Include="Sprite\ISprite.cs" />
+    <Compile Include="Sprite\Monkey.cs" />
+    <Compile Include="Sprite\ScrollingBackground.cs" />
+    <Compile Include="Sprite\Sprite.cs" />
+    <Compile Include="Sprite\SpriteManager.cs" />
+    <Compile Include="Sprite\TextSprite.cs" />
+    <Compile Include="StartScreen.cs" />
+    <Compile Include="XnaExtensions.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ApplicationDefinition Include="App.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </ApplicationDefinition>
+    <Page Include="MainPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Properties\AppManifest.xml" />
+  </ItemGroup>
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Silverlight\$(SilverlightVersion)\Microsoft.Silverlight.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
+        <SilverlightProjectProperties />
+      </FlavorProperties>
+      <UserProperties ProjectLinkerExcludeFilter="\\?desktop(\\.*)?$;\\?silverlight(\\.*)?$;\.desktop;\.silverlight;\.xaml;^service references(\\.*)?$;\.clientconfig;^web references(\\.*)?$" ProjectLinkReference="f95ebb11-67ca-4826-bc97-b08bd15d7b25" />
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>

OMG/OMG.Windows.csproj

     </Reference>
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CharacterCreatorGame.cs" />
     <Compile Include="GameController\GameControllerAction.cs" />
     <Compile Include="GameController\GameControllerState.cs" />
     <Compile Include="GameController\KeyboardController.cs" />

OMG/OMG.Xbox.csproj

     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CharacterCreatorGame.cs" />
     <Compile Include="GameController\GameControllerAction.cs">
       <SubType>Code</SubType>
     </Compile>

OMG/Properties/AppManifest.xml

+<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+>
+    <Deployment.Parts>
+    </Deployment.Parts>
+</Deployment>

OMG/Sprite/Cursor.cs

 using System.Collections.Generic;
 using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
 using OMG.GameController;
 
 namespace OMG.Sprite
             DrawOrder = int.MaxValue;
         }
 
-        protected bool Selected;
-
         private Color? _lastTint;
         public override void Update(GameTime gameTime, GameControllerState gameControllerState)
         {

OMG/StartScreen.cs

-using Microsoft.Xna.Framework;
+using System;
+using Microsoft.Xna.Framework;
 using OMG.MiniGame;
 using OMG.MiniGame.AgilityCourse;
 using OMG.Sprite;
     public class StartScreen : MiniGameBase
     {
         private TextSprite _title;
-        private DialogOption _startGameOption;
+        private DialogOption _loadGameOption;
+        private DialogOption _newGameOption;
         private Cursor _cursor;
 
         protected override void InitializeSprites()
         {
             _title = new TextSprite(GameFont.Title, "OMG Ponies, Puppies and Kitties");
 
-            _startGameOption = new DialogOption("Start");
-            _startGameOption.DialogOptionSelected += delegate { StartGame(); };
-            
+            _loadGameOption = new DialogOption("Load");
+            _loadGameOption.DialogOptionSelected += delegate { StartGame(); };
+            _newGameOption = new DialogOption("New");
+            _newGameOption.DialogOptionSelected += delegate { NewGame(); };
             _cursor = new Cursor();
 
             Sprites.Add(_title);
-            Sprites.Add(_startGameOption);
+            Sprites.Add(_loadGameOption);
+            Sprites.Add(_newGameOption);
             Sprites.Add(_cursor);
         }
 
         {
             base.LoadContent();
 
-            _startGameOption.Position = new Vector2(GameScreen.SafeArea.Width / 2, GameScreen.SafeArea.Height / 2);
+            var startX = GameScreen.SafeArea.Width/2;
+            var startY = GameScreen.SafeArea.Height/2;
+            _newGameOption.Position = new Vector2(startX, startY);
+            _loadGameOption.Position = new Vector2(startX, startY + _newGameOption.Size.Height + 5);
+        }
+
+        private void NewGame()
+        {
+            NotifyGameComplete(new CharacterCreatorGame());
         }
 
         private void StartGame()