瀏覽代碼

CatapultNetWars update to SDK and MG 3.8.*. Networking needs fixing. references top level, MonoGame.Xna.Framework.Net

CartBlanche 2 周之前
父節點
當前提交
f970b2712a
共有 100 個文件被更改,包括 993 次插入6539 次删除
  1. 0 32
      CatapaultWars/Activity1.cs
  2. 0 129
      CatapaultWars/CatapaultGame.MacOS.csproj
  3. 0 603
      CatapaultWars/Catapult/Catapult.cs
  4. 0 191
      CatapaultWars/Catapult/Projectile.cs
  5. 0 84
      CatapaultWars/CatapultGame.cs
  6. 0 293
      CatapaultWars/CatapultWars.Android.csproj
  7. 0 244
      CatapaultWars/CatapultWars.iOS.csproj
  8. 0 63
      CatapaultWars/Content/Textures/Catapults/AnimationsDef.xml
  9. 0 79
      CatapaultWars/Players/AI.cs
  10. 0 195
      CatapaultWars/Players/Human.cs
  11. 0 94
      CatapaultWars/Players/Player.cs
  12. 0 94
      CatapaultWars/Program.cs
  13. 0 28
      CatapaultWars/Properties/AssemblyInfo.cs
  14. 0 73
      CatapaultWars/Resources/Resource.designer.cs
  15. 二進制
      CatapaultWars/Resources/drawable/Icon.png
  16. 0 8
      CatapaultWars/Resources/layout/Main.axml
  17. 0 4
      CatapaultWars/Resources/values/Strings.xml
  18. 0 347
      CatapaultWars/ScreenManager/InputState.cs
  19. 0 323
      CatapaultWars/ScreenManager/MenuScreen.cs
  20. 0 53
      CatapaultWars/ScreenManager/MouseGestureType.cs
  21. 0 42
      CatapaultWars/ScreenManager/PlayerIndexEventArgs.cs
  22. 0 450
      CatapaultWars/ScreenManager/ScreenManager.cs
  23. 0 58
      CatapaultWars/Screens/BackgroundScreen.cs
  24. 0 507
      CatapaultWars/Screens/GameplayScreen.cs
  25. 0 188
      CatapaultWars/Screens/InstructionsScreen.cs
  26. 27 0
      CatapultNetWars/.vscode/launch.json
  27. 47 0
      CatapultNetWars/.vscode/tasks.json
  28. 0 34
      CatapultNetWars/Activity1.cs
  29. 二進制
      CatapultNetWars/Background.png
  30. 0 269
      CatapultNetWars/CatapaultNetWars.Windows.csproj
  31. 0 337
      CatapultNetWars/CatapultNetWars.Android.csproj
  32. 0 323
      CatapultNetWars/CatapultNetWars.Linux.csproj
  33. 0 155
      CatapultNetWars/CatapultNetWars.MacOS.csproj
  34. 0 311
      CatapultNetWars/CatapultNetWars.iOS.csproj
  35. 48 26
      CatapultNetWars/CatapultNetWars.sln
  36. 二進制
      CatapultNetWars/Content/Fonts/HUDFont.xnb
  37. 二進制
      CatapultNetWars/Content/Fonts/MenuFont.xnb
  38. 二進制
      CatapultNetWars/Content/Sounds/BoulderHit.wav
  39. 二進制
      CatapultNetWars/Content/Sounds/BoulderHit.xnb
  40. 二進制
      CatapultNetWars/Content/Sounds/CatapultExplosion.wav
  41. 二進制
      CatapultNetWars/Content/Sounds/CatapultExplosion.xnb
  42. 二進制
      CatapultNetWars/Content/Sounds/CatapultFire.wav
  43. 二進制
      CatapultNetWars/Content/Sounds/CatapultFire.xnb
  44. 二進制
      CatapultNetWars/Content/Sounds/Lose.wav
  45. 二進制
      CatapultNetWars/Content/Sounds/Lose.xnb
  46. 二進制
      CatapultNetWars/Content/Sounds/RopeStretch.wav
  47. 二進制
      CatapultNetWars/Content/Sounds/RopeStretch.xnb
  48. 二進制
      CatapultNetWars/Content/Sounds/Win.wav
  49. 二進制
      CatapultNetWars/Content/Sounds/Win.xnb
  50. 二進制
      CatapultNetWars/Content/Textures/Ammo/rock_ammo.xnb
  51. 二進制
      CatapultNetWars/Content/Textures/Backgrounds/blank.xnb
  52. 二進制
      CatapultNetWars/Content/Textures/Backgrounds/cloud1.xnb
  53. 二進制
      CatapultNetWars/Content/Textures/Backgrounds/cloud2.xnb
  54. 二進制
      CatapultNetWars/Content/Textures/Backgrounds/defeat.xnb
  55. 二進制
      CatapultNetWars/Content/Textures/Backgrounds/gameplay_screen.xnb
  56. 二進制
      CatapultNetWars/Content/Textures/Backgrounds/instructions.xnb
  57. 二進制
      CatapultNetWars/Content/Textures/Backgrounds/mountain.xnb
  58. 二進制
      CatapultNetWars/Content/Textures/Backgrounds/sky.xnb
  59. 二進制
      CatapultNetWars/Content/Textures/Backgrounds/title_screen.xnb
  60. 二進制
      CatapultNetWars/Content/Textures/Backgrounds/victory.xnb
  61. 二進制
      CatapultNetWars/Content/Textures/Catapults/Blue/blueDestroyed/blueCatapult_destroyed.xnb
  62. 二進制
      CatapultNetWars/Content/Textures/Catapults/Blue/blueFire/blueCatapult_fire.xnb
  63. 二進制
      CatapultNetWars/Content/Textures/Catapults/Blue/blueIdle/blueIdle.xnb
  64. 二進制
      CatapultNetWars/Content/Textures/Catapults/Blue/bluePullback/blueCatapult_Pullback.xnb
  65. 二進制
      CatapultNetWars/Content/Textures/Catapults/Fire_Miss/fire_miss.xnb
  66. 二進制
      CatapultNetWars/Content/Textures/Catapults/Hit_Smoke/smoke.xnb
  67. 二進制
      CatapultNetWars/Content/Textures/Catapults/Red/redDestroyed/redCatapult_destroyed.xnb
  68. 二進制
      CatapultNetWars/Content/Textures/Catapults/Red/redFire/redCatapult_fire.xnb
  69. 二進制
      CatapultNetWars/Content/Textures/Catapults/Red/redIdle/redIdle.xnb
  70. 二進制
      CatapultNetWars/Content/Textures/Catapults/Red/redPullback/redCatapult_Pullback.xnb
  71. 二進制
      CatapultNetWars/Content/Textures/HUD/Arrow.xnb
  72. 二進制
      CatapultNetWars/Content/Textures/HUD/ammoType.xnb
  73. 二進制
      CatapultNetWars/Content/Textures/HUD/hudBackground.xnb
  74. 二進制
      CatapultNetWars/Content/Textures/HUD/windArrow.xnb
  75. 585 603
      CatapultNetWars/Core/Catapult/Catapult.cs
  76. 94 108
      CatapultNetWars/Core/Catapult/CatapultGame.cs
  77. 177 191
      CatapultNetWars/Core/Catapult/Projectile.cs
  78. 15 0
      CatapultNetWars/Core/CatapultNetWars.Core.csproj
  79. 0 0
      CatapultNetWars/Core/Content/Background.png
  80. 0 0
      CatapultNetWars/Core/Content/Fonts/HUDFont.xnb
  81. 0 0
      CatapultNetWars/Core/Content/Fonts/MenuFont.xnb
  82. 0 0
      CatapultNetWars/Core/Content/Game.ico
  83. 0 0
      CatapultNetWars/Core/Content/Sounds/BoulderHit.wav
  84. 0 0
      CatapultNetWars/Core/Content/Sounds/BoulderHit.xnb
  85. 0 0
      CatapultNetWars/Core/Content/Sounds/CatapultExplosion.wav
  86. 0 0
      CatapultNetWars/Core/Content/Sounds/CatapultExplosion.xnb
  87. 0 0
      CatapultNetWars/Core/Content/Sounds/CatapultFire.wav
  88. 0 0
      CatapultNetWars/Core/Content/Sounds/CatapultFire.xnb
  89. 0 0
      CatapultNetWars/Core/Content/Sounds/Lose.wav
  90. 0 0
      CatapultNetWars/Core/Content/Sounds/Lose.xnb
  91. 0 0
      CatapultNetWars/Core/Content/Sounds/RopeStretch.wav
  92. 0 0
      CatapultNetWars/Core/Content/Sounds/RopeStretch.xnb
  93. 0 0
      CatapultNetWars/Core/Content/Sounds/Win.wav
  94. 0 0
      CatapultNetWars/Core/Content/Sounds/Win.xnb
  95. 0 0
      CatapultNetWars/Core/Content/Textures/Ammo/rock_ammo.xnb
  96. 0 0
      CatapultNetWars/Core/Content/Textures/Backgrounds/blank.xnb
  97. 0 0
      CatapultNetWars/Core/Content/Textures/Backgrounds/cloud1.xnb
  98. 0 0
      CatapultNetWars/Core/Content/Textures/Backgrounds/cloud2.xnb
  99. 0 0
      CatapultNetWars/Core/Content/Textures/Backgrounds/defeat.xnb
  100. 0 0
      CatapultNetWars/Core/Content/Textures/Backgrounds/gameplay_screen.xnb

+ 0 - 32
CatapaultWars/Activity1.cs

@@ -1,32 +0,0 @@
-using System;
-
-using Android.App;
-using Android.Content;
-using Android.Runtime;
-using Android.Views;
-using Android.Widget;
-using Android.OS;
-using Microsoft.Xna.Framework;
-using Android.Content.PM;
-
-namespace CatapultWars
-{
-	[Activity (Label = "MonoGame.Samples.CatapultWars"
-	           , MainLauncher = true
-	           ,ConfigurationChanges=ConfigChanges.Orientation|ConfigChanges.Keyboard|ConfigChanges.KeyboardHidden)]
-	public class Activity1 : AndroidGameActivity
-	{
-		protected override void OnCreate (Bundle bundle)
-		{
-			base.OnCreate (bundle);
-			
-			CatapultGame.CatapultGame.Activity = this;
-			var g = new CatapultGame.CatapultGame();
-			SetContentView(g.Window);
-			g.Run();
-			
-		}		
-	}
-}
-
-

+ 0 - 129
CatapaultWars/CatapaultGame.MacOS.csproj

@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{1F4BF77D-34DA-417D-96DE-24213A05729B}</ProjectGuid>
-    <ProjectTypeGuids>{948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>CatapaultGame</RootNamespace>
-    <AssemblyName>Catapault</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG; MONOMAC</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <ConsolePause>False</ConsolePause>
-    <EnableCodeSigning>False</EnableCodeSigning>
-    <CreatePackage>False</CreatePackage>
-    <EnablePackageSigning>False</EnablePackageSigning>
-    <IncludeMonoRuntime>False</IncludeMonoRuntime>
-    <UseSGen>False</UseSGen>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <ConsolePause>False</ConsolePause>
-    <EnableCodeSigning>False</EnableCodeSigning>
-    <CreatePackage>False</CreatePackage>
-    <EnablePackageSigning>False</EnablePackageSigning>
-    <IncludeMonoRuntime>False</IncludeMonoRuntime>
-    <UseSGen>False</UseSGen>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="MonoMac" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Info.plist">
-    </None>
-    <None Include="Background.png" />
-    <None Include="Game.ico" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
-  <ItemGroup>
-    <Compile Include="CatapultGame.cs" />
-    <Compile Include="Program.cs" />
-    <Compile Include="Catapult\Catapult.cs" />
-    <Compile Include="Catapult\Projectile.cs" />
-    <Compile Include="Players\AI.cs" />
-    <Compile Include="Players\Human.cs" />
-    <Compile Include="Players\Player.cs" />
-    <Compile Include="ScreenManager\GameScreen.cs" />
-    <Compile Include="ScreenManager\InputState.cs" />
-    <Compile Include="ScreenManager\MenuEntry.cs" />
-    <Compile Include="ScreenManager\MenuScreen.cs" />
-    <Compile Include="ScreenManager\PlayerIndexEventArgs.cs" />
-    <Compile Include="ScreenManager\ScreenManager.cs" />
-    <Compile Include="Screens\BackgroundScreen.cs" />
-    <Compile Include="Screens\GameplayScreen.cs" />
-    <Compile Include="Screens\InstructionsScreen.cs" />
-    <Compile Include="Screens\MainMenuScreen.cs" />
-    <Compile Include="Screens\PauseScreen.cs" />
-    <Compile Include="Utility\Animation.cs" />
-    <Compile Include="Utility\AudioManager.cs" />
-    <Compile Include="ScreenManager\MouseGestureType.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Content\Fonts\HUDFont.xnb" />
-    <Content Include="Content\Fonts\MenuFont.xnb" />
-    <Content Include="Content\Sounds\BoulderHit.xnb" />
-    <Content Include="Content\Sounds\CatapultExplosion.xnb" />
-    <Content Include="Content\Sounds\CatapultFire.xnb" />
-    <Content Include="Content\Sounds\Lose.xnb" />
-    <Content Include="Content\Sounds\RopeStretch.xnb" />
-    <Content Include="Content\Sounds\Win.xnb" />
-    <Content Include="Content\Textures\Ammo\rock_ammo.xnb" />
-    <Content Include="Content\Textures\Backgrounds\blank.xnb" />
-    <Content Include="Content\Textures\Backgrounds\cloud1.xnb" />
-    <Content Include="Content\Textures\Backgrounds\cloud2.xnb" />
-    <Content Include="Content\Textures\Backgrounds\defeat.xnb" />
-    <Content Include="Content\Textures\Backgrounds\gameplay_screen.xnb" />
-    <Content Include="Content\Textures\Backgrounds\instructions.xnb" />
-    <Content Include="Content\Textures\Backgrounds\mountain.xnb" />
-    <Content Include="Content\Textures\Backgrounds\sky.xnb" />
-    <Content Include="Content\Textures\Backgrounds\title_screen.xnb" />
-    <Content Include="Content\Textures\Backgrounds\victory.xnb" />
-    <Content Include="Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb" />
-    <Content Include="Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb" />
-    <Content Include="Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb" />
-    <Content Include="Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb" />
-    <Content Include="Content\Textures\Catapults\Fire_Miss\fire_miss.xnb" />
-    <Content Include="Content\Textures\Catapults\Hit_Smoke\smoke.xnb" />
-    <Content Include="Content\Textures\Catapults\AnimationsDef.xml" />
-    <Content Include="Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb" />
-    <Content Include="Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb" />
-    <Content Include="Content\Textures\Catapults\Red\redIdle\redIdle.xnb" />
-    <Content Include="Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb" />
-    <Content Include="Content\Textures\HUD\Arrow.xnb" />
-    <Content Include="Content\Textures\HUD\ammoType.xnb" />
-    <Content Include="Content\Textures\HUD\hudBackground.xnb" />
-    <Content Include="Content\Textures\HUD\windArrow.xnb" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\MonoGame.Framework\MonoGame.Framework.MacOS.csproj">
-      <Project>{36C538E6-C32A-4A8D-A39C-566173D7118E}</Project>
-      <Name>MonoGame.Framework.MacOS</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\ThirdParty\Lidgren.Network\Lidgren.Network.MacOS.csproj">
-      <Project>{AE483C29-042E-4226-BA52-D247CE7676DA}</Project>
-      <Name>Lidgren.Network.MacOS</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>

+ 0 - 603
CatapaultWars/Catapult/Catapult.cs

@@ -1,603 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// Catapult.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region File Information
-//-----------------------------------------------------------------------------
-// Animation.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input.Touch;
-//using Microsoft.Devices;
-using System.Xml.Linq;
-#endregion
-
-namespace CatapultGame
-{
-    #region Catapult states definition enum
-    [Flags]
-    public enum CatapultState
-    {
-        Idle = 0x0,
-        Aiming = 0x1,
-        Firing = 0x2,
-        ProjectileFlying = 0x4,
-        ProjectileHit = 0x8,
-        Hit = 0x10,
-        Reset = 0x20,
-        Stalling = 0x40
-    }
-    #endregion
-
-    public class Catapult : DrawableGameComponent
-    {
-        #region Variables/Fields and Properties
-        // Hold what the game to which the catapult belongs
-        CatapultGame curGame = null;
-
-        SpriteBatch spriteBatch;
-        Random random;
-
-        public bool AnimationRunning { get; set; }
-        public string Name { get; set; }
-        public bool IsActive { get; set; }
-
-        // In some cases the game need to start second animation while first animation is still running;
-        // this variable define at which frame the second animation should start
-        Dictionary<string, int> splitFrames;
-
-        Texture2D idleTexture;
-        Dictionary<string, Animation> animations;
-
-        SpriteEffects spriteEffects;
-
-        // Projectile
-        Projectile projectile;
-
-        string idleTextureName;
-        bool isAI;
-
-        // Game constants
-        const float gravity = 500f;
-
-        // State of the catapult during its last update
-        CatapultState lastUpdateState = CatapultState.Idle;
-
-        // Used to stall animations
-        int stallUpdateCycles;
-
-        // Current state of the Catapult
-        CatapultState currentState;
-        public CatapultState CurrentState
-        {
-            get { return currentState; }
-            set { currentState = value; }
-        }
-
-        float wind;
-        public float Wind
-        {
-            set
-            {
-                wind = value;
-            }
-        }
-
-        Player enemy;
-        internal Player Enemy
-        {
-            set
-            {
-                enemy = value;
-            }
-        }
-
-        Player self;
-        internal Player Self
-        {
-            set
-            {
-                self = value;
-            }
-        }
-
-        Vector2 catapultPosition;
-        public Vector2 Position
-        {
-            get
-            {
-                return catapultPosition;
-            }
-        }
-
-        /// <summary>
-        /// Describes how powerful the current shot being fired is. The more powerful
-        /// the shot, the further it goes. 0 is the weakest, 1 is the strongest.
-        /// </summary>
-        public float ShotStrength { get; set; }
-
-        public float ShotVelocity { get; set; }
-
-        /// <summary>
-        /// Used to determine whether or not the game is over
-        /// </summary>
-        public bool GameOver { get; set; }
-
-        const int winScore = 5;
-        #endregion
-
-        #region Initialization
-        public Catapult(Game game)
-            : base(game)
-        {
-            curGame = (CatapultGame)game;
-        }
-
-        public Catapult(Game game, SpriteBatch screenSpriteBatch,
-          string IdleTexture,
-          Vector2 CatapultPosition, SpriteEffects SpriteEffect, bool IsAI)
-            : this(game)
-        {
-            idleTextureName = IdleTexture;
-            catapultPosition = CatapultPosition;
-            spriteEffects = SpriteEffect;
-            spriteBatch = screenSpriteBatch;
-            isAI = IsAI;
-
-            splitFrames = new Dictionary<string, int>();
-            animations = new Dictionary<string, Animation>();
-        }
-
-        /// <summary>
-        /// Function initializes the catapult instance and loads the animations from XML definition sheet
-        /// </summary>
-        public override void Initialize()
-        {
-            // Define initial state of the catapult
-            IsActive = true;
-            AnimationRunning = false;
-            currentState = CatapultState.Idle;
-            stallUpdateCycles = 0;
-
-            // Load multiple animations form XML definition
-			XDocument doc = null;
-#if ANDROID
-			using(var stream = Game.Activity.Assets.Open(@"Content/Textures/Catapults/AnimationsDef.xml"))
-			{
-				doc = XDocument.Load(stream);
-			}
-#else			
-            doc = XDocument.Load("Content/Textures/Catapults/AnimationsDef.xml");            
-#endif		
-			XName name = XName.Get("Definition");
-            var definitions = doc.Document.Descendants(name);
-
-            // Loop over all definitions in XML
-            foreach (var animationDefinition in definitions)
-            {
-                bool? toLoad = null;
-                bool val;
-                if (bool.TryParse(animationDefinition.Attribute("IsAI").Value, out val))
-                    toLoad = val;
-
-                // Check if the animation definition need to be loaded for current catapult
-                if (toLoad == isAI || null == toLoad)
-                {
-                    // Get a name of the animation
-                    string animatonAlias = animationDefinition.Attribute("Alias").Value;
-                    Texture2D texture =
-                        curGame.Content.Load<Texture2D>(animationDefinition.Attribute("SheetName").Value);
-
-                    // Get the frame size (width & height)
-                    Point frameSize = new Point();
-                    frameSize.X = int.Parse(animationDefinition.Attribute("FrameWidth").Value);
-                    frameSize.Y = int.Parse(animationDefinition.Attribute("FrameHeight").Value);
-
-                    // Get the frames sheet dimensions
-                    Point sheetSize = new Point();
-                    sheetSize.X = int.Parse(animationDefinition.Attribute("SheetColumns").Value);
-                    sheetSize.Y = int.Parse(animationDefinition.Attribute("SheetRows").Value);
-
-                    // If definition has a "SplitFrame" - means that other animation should start here - load it
-                    if (null != animationDefinition.Attribute("SplitFrame"))
-                        splitFrames.Add(animatonAlias,
-                            int.Parse(animationDefinition.Attribute("SplitFrame").Value));
-
-                    // Defing animation speed
-                    TimeSpan frameInterval = TimeSpan.FromSeconds((float)1 /
-                        int.Parse(animationDefinition.Attribute("Speed").Value));
-
-                    Animation animation = new Animation(texture, frameSize, sheetSize);
-
-                    // If definition has an offset defined - means that it should be rendered relatively
-                    // to some element/other animation - load it
-                    if (null != animationDefinition.Attribute("OffsetX") &&
-                      null != animationDefinition.Attribute("OffsetY"))
-                    {
-                        animation.Offset = new Vector2(int.Parse(animationDefinition.Attribute("OffsetX").Value),
-                            int.Parse(animationDefinition.Attribute("OffsetY").Value));
-                    }
-
-                    animations.Add(animatonAlias, animation);
-                }
-            }
-
-            // Load the textures
-            idleTexture = curGame.Content.Load<Texture2D>(idleTextureName);
-
-            // Initialize the projectile
-            Vector2 projectileStartPosition;
-            if (isAI)
-                projectileStartPosition = new Vector2(630, 340);
-            else
-                projectileStartPosition = new Vector2(175, 340);
-
-            projectile = new Projectile(curGame, spriteBatch, "Textures/Ammo/rock_ammo",
-              projectileStartPosition, animations["Fire"].FrameSize.Y, isAI, gravity);
-            projectile.Initialize();
-
-            // Initialize randomizer
-            random = new Random();
-
-            base.Initialize();
-        }
-        #endregion
-
-        #region Update and Render
-        public override void Update(GameTime gameTime)
-        {
-            bool isGroundHit;
-            bool startStall;
-            CatapultState postUpdateStateChange = 0;
-
-            if (gameTime == null)
-                throw new ArgumentNullException("gameTime");
-
-            // The catapult is inactive, so there is nothing to update
-            if (!IsActive)
-            {
-                base.Update(gameTime);
-                return;
-            }
-                
-            switch (currentState)
-            {
-                case CatapultState.Idle:
-                    // Nothing to do
-                    break;
-                case CatapultState.Aiming:
-                    if (lastUpdateState != CatapultState.Aiming)
-                    {
-                        AudioManager.PlaySound("ropeStretch", true);
-
-                        AnimationRunning = true;
-                        if (isAI == true)
-                        {
-                            animations["Aim"].PlayFromFrameIndex(0);
-                            stallUpdateCycles = 20;
-                            startStall = false;
-                        }
-                    }
-
-                    // Progress Aiming "animation"
-                    if (isAI == false)
-                    {
-                        UpdateAimAccordingToShotStrength();
-                    }
-                    else
-                    {
-                        animations["Aim"].Update();
-                        startStall = AimReachedShotStrength();
-                        currentState = (startStall) ? 
-                            CatapultState.Stalling : CatapultState.Aiming;
-                    }
-                    break;
-                case CatapultState.Stalling:
-                    if (stallUpdateCycles-- <= 0)
-                    {
-                        // We've finished stalling, fire the projectile
-                        Fire(ShotVelocity);
-                        postUpdateStateChange = CatapultState.Firing;
-                    }
-                    break;
-                case CatapultState.Firing:
-                    // Progress Fire animation
-                    if (lastUpdateState != CatapultState.Firing)
-                    {
-                        AudioManager.StopSound("ropeStretch");
-                        AudioManager.PlaySound("catapultFire");
-                        StartFiringFromLastAimPosition();
-                    }
-
-                    animations["Fire"].Update();
-
-                    // If in the "split" point of the animation start 
-                    // projectile fire sequence
-                    if (animations["Fire"].FrameIndex == splitFrames["Fire"])
-                    {
-                        postUpdateStateChange = 
-                            currentState | CatapultState.ProjectileFlying;
-                        projectile.ProjectilePosition = 
-                            projectile.ProjectileStartPosition;
-                    }
-                    break;
-                case CatapultState.Firing | CatapultState.ProjectileFlying:
-                    // Progress Fire animation                    
-                    animations["Fire"].Update();
-
-                    // Update projectile velocity & position in flight
-                    projectile.UpdateProjectileFlightData(gameTime, wind, 
-                        gravity, out isGroundHit);
-
-                    if (isGroundHit)
-                    {
-                        // Start hit sequence
-                        postUpdateStateChange = CatapultState.ProjectileHit;
-                        animations["fireMiss"].PlayFromFrameIndex(0);
-                    }
-                    break;
-                case CatapultState.ProjectileFlying:
-                    // Update projectile velocity & position in flight
-                    projectile.UpdateProjectileFlightData(gameTime, wind, 
-                        gravity, out isGroundHit);
-                    if (isGroundHit)
-                    {
-                        // Start hit sequence
-                        postUpdateStateChange = CatapultState.ProjectileHit;
-                        animations["fireMiss"].PlayFromFrameIndex(0);
-                    }
-
-                    break;
-                case CatapultState.ProjectileHit:
-                    // Check hit on ground impact
-                    if (!CheckHit())
-                    {
-                        if (lastUpdateState != CatapultState.ProjectileHit)
-                        {
-//                            VibrateController.Default.Start(
-//                                TimeSpan.FromMilliseconds(100));
-                            // Play hit sound only on a missed hit,
-                            // a direct hit will trigger the explosion sound
-                            AudioManager.PlaySound("boulderHit");
-                        }
-
-                        // Hit animation finished playing
-                        if (animations["fireMiss"].IsActive == false)
-                        {
-                            postUpdateStateChange = CatapultState.Reset;
-                        }
-
-                        animations["fireMiss"].Update();
-                    }
-                    else
-                    {
-                        // Catapult hit - start longer vibration on any catapult hit 
-                        // Remember that the call to "CheckHit" updates the catapult's
-                        // state to "Hit"
-//                        VibrateController.Default.Start(
-//                            TimeSpan.FromMilliseconds(500));
-                    }
-
-                    break;
-                case CatapultState.Hit:
-                    // Progress hit animation
-                    if ((animations["Destroyed"].IsActive == false) &&
-                        (animations["hitSmoke"].IsActive == false))
-                    {
-                        if (enemy.Score >= winScore)
-                        {
-                            GameOver = true;
-                            break;
-                        }
-
-                        postUpdateStateChange = CatapultState.Reset;
-                    }
-
-                    animations["Destroyed"].Update();
-                    animations["hitSmoke"].Update();
-
-                    break;
-                case CatapultState.Reset:
-                    AnimationRunning = false;
-                    break;
-                default:
-                    break;
-            }
-
-            lastUpdateState = currentState;
-            if (postUpdateStateChange != 0)
-            {
-                currentState = postUpdateStateChange;
-            }
-
-            base.Update(gameTime);
-        }
-
-        /// <summary>
-        /// Used to check if the current aim animation frame represents the shot
-        /// strength set for the catapult.
-        /// </summary>
-        /// <returns>True if the current frame represents the shot strength,
-        /// false otherwise.</returns>
-        private bool AimReachedShotStrength()
-        {
-            return (animations["Aim"].FrameIndex ==
-                (Convert.ToInt32(animations["Aim"].FrameCount * ShotStrength) - 1));
-        }
-
-        private void UpdateAimAccordingToShotStrength()
-        {
-            var aimAnimation = animations["Aim"];
-            int frameToDisplay =
-                Convert.ToInt32(aimAnimation.FrameCount * ShotStrength);
-            aimAnimation.FrameIndex = frameToDisplay;
-        }
-
-        /// <summary>
-        /// Calculates the frame from which to start the firing animation, 
-        /// and activates it.
-        /// </summary>
-        private void StartFiringFromLastAimPosition()
-        {
-            int startFrame = animations["Aim"].FrameCount -
-                animations["Aim"].FrameIndex;
-            animations["Fire"].PlayFromFrameIndex(startFrame);
-        }
-
-        public override void Draw(GameTime gameTime)
-        {
-            if (gameTime == null)
-                throw new ArgumentNullException("gameTime");
-
-            // Using the last update state makes sure we do not draw
-            // before updating animations properly
-            switch (lastUpdateState)
-            {
-                case CatapultState.Idle:
-                    DrawIdleCatapult();
-                    break;
-                case CatapultState.Aiming:
-                case CatapultState.Stalling:
-                    animations["Aim"].Draw(spriteBatch, catapultPosition,
-                        spriteEffects);
-                    break;
-                case CatapultState.Firing:
-                    animations["Fire"].Draw(spriteBatch, catapultPosition,
-                        spriteEffects);
-                    break;
-                case CatapultState.Firing | CatapultState.ProjectileFlying:
-                case CatapultState.ProjectileFlying:
-                    animations["Fire"].Draw(spriteBatch, catapultPosition,
-                        spriteEffects);
-
-                    projectile.Draw(gameTime);
-                    break;
-                case CatapultState.ProjectileHit:
-                    // Draw the catapult
-                    DrawIdleCatapult();
-
-                    // Projectile Hit animation
-                    animations["fireMiss"].Draw(spriteBatch,
-                        projectile.ProjectileHitPosition, spriteEffects);
-                    break;
-                case CatapultState.Hit:
-                    // Catapult hit animation
-                    animations["Destroyed"].Draw(spriteBatch, catapultPosition,
-                        spriteEffects);
-
-                    // Projectile smoke animation
-                    animations["hitSmoke"].Draw(spriteBatch, catapultPosition,
-                        spriteEffects);
-                    break;
-                case CatapultState.Reset:
-                    DrawIdleCatapult();
-                    break;
-                default:
-                    break;
-            }
-
-            base.Draw(gameTime);
-        }
-        #endregion
-
-        #region Hit
-        /// <summary>
-        /// Start Hit sequence on catapult - could be executed on self or from enemy in case of hit
-        /// </summary>
-        public void Hit()
-        {
-            AnimationRunning = true;
-            animations["Destroyed"].PlayFromFrameIndex(0);
-            animations["hitSmoke"].PlayFromFrameIndex(0);
-            currentState = CatapultState.Hit;
-        }
-        #endregion
-
-        public void Fire(float velocity)
-        {
-            projectile.Fire(velocity, velocity);
-        }
-
-        #region Helper Functions
-        /// <summary>
-        /// Check if projectile hit some catapult. The possibilities are:
-        /// Nothing hit, Hit enemy, Hit self
-        /// </summary>
-        /// <returns></returns>
-        private bool CheckHit()
-        {
-            bool bRes = false;
-            // Build a sphere around a projectile
-            Vector3 center = new Vector3(projectile.ProjectilePosition, 0);
-            BoundingSphere sphere = new BoundingSphere(center,
-                Math.Max(projectile.ProjectileTexture.Width / 2,
-                projectile.ProjectileTexture.Height / 2));
-
-            // Check Self-Hit - create a bounding box around self
-            Vector3 min = new Vector3(catapultPosition, 0);
-            Vector3 max = new Vector3(catapultPosition +
-                new Vector2(animations["Fire"].FrameSize.X,
-                    animations["Fire"].FrameSize.Y), 0);
-            BoundingBox selfBox = new BoundingBox(min, max);
-
-            // Check enemy - create a bounding box around the enemy
-            min = new Vector3(enemy.Catapult.Position, 0);
-            max = new Vector3(enemy.Catapult.Position +
-                new Vector2(animations["Fire"].FrameSize.X,
-                    animations["Fire"].FrameSize.Y), 0);
-            BoundingBox enemyBox = new BoundingBox(min, max);
-
-            // Check self hit
-            if (sphere.Intersects(selfBox) && currentState != CatapultState.Hit)
-            {
-                AudioManager.PlaySound("catapultExplosion");
-                // Launch hit animation sequence on self
-                Hit();
-                enemy.Score++;
-                bRes = true;
-            }
-            // Check if enemy was hit
-            else if (sphere.Intersects(enemyBox)
-                && enemy.Catapult.CurrentState != CatapultState.Hit
-                && enemy.Catapult.CurrentState != CatapultState.Reset)
-            {
-                AudioManager.PlaySound("catapultExplosion");
-                // Launch enemy hit animaton
-                enemy.Catapult.Hit();
-                self.Score++;
-                bRes = true;
-                currentState = CatapultState.Reset;
-            }
-
-            return bRes;
-        }
-
-        /// <summary>
-        /// Draw catapult in Idle state
-        /// </summary>
-        private void DrawIdleCatapult()
-        {
-            spriteBatch.Draw(idleTexture, catapultPosition, null, Color.White,
-              0.0f, Vector2.Zero, 1.0f,
-              spriteEffects, 0);
-        }
-        #endregion
-
-    }
-}

+ 0 - 191
CatapaultWars/Catapult/Projectile.cs

@@ -1,191 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// Projectile.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region File Information
-//-----------------------------------------------------------------------------
-// Projectile.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-#endregion
-
-namespace CatapultGame
-{
-    class Projectile : DrawableGameComponent
-    {
-        #region Fields/Properties
-        SpriteBatch spriteBatch;
-        Game curGame;
-        Random random;
-
-        // Textures for projectile
-        string textureName;
-        // Position and speed of projectile
-        Vector2 projectileVelocity = Vector2.Zero;
-        float projectileInitialVelocityY;
-        Vector2 projectileRotationPosition = Vector2.Zero;
-        float projectileRotation;
-        float flightTime;
-        bool isAI;
-        float hitOffset;
-        float gravity;
-
-        Vector2 projectileStartPosition;
-        public Vector2 ProjectileStartPosition
-        {
-            get
-            {
-                return projectileStartPosition;
-            }
-            set
-            {
-                projectileStartPosition = value;
-            }
-        }
-
-        Vector2 projectilePosition = Vector2.Zero;
-        public Vector2 ProjectilePosition
-        {
-            get
-            {
-                return projectilePosition;
-            }
-            set
-            {
-                projectilePosition = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets the position where the projectile hit the ground.
-        /// Only valid after a hit occurs.
-        /// </summary>
-        public Vector2 ProjectileHitPosition { get; private set; }
-
-        Texture2D projectileTexture;
-        public Texture2D ProjectileTexture
-        {
-            get
-            {
-                return projectileTexture;
-            }
-            set
-            {
-                projectileTexture = value;
-            }
-        }
-        #endregion
-
-        #region Initialization
-        public Projectile(Game game)
-            : base(game)
-        {
-            curGame = game;
-            random = new Random();
-        }
-
-        public Projectile(Game game, SpriteBatch screenSpriteBatch,
-          string TextureName, Vector2 startPosition, float groundHitOffset,
-          bool isAi, float Gravity)
-            : this(game)
-        {
-            spriteBatch = screenSpriteBatch;
-            projectileStartPosition = startPosition;
-            textureName = TextureName;
-            isAI = isAi;
-            hitOffset = groundHitOffset;
-            gravity = Gravity;
-        }
-
-        public override void Initialize()
-        {
-            // Load a projectile texture
-            projectileTexture = curGame.Content.Load<Texture2D>(textureName);
-        }
-        #endregion
-
-        #region Render
-        public override void Draw(GameTime gameTime)
-        {
-            spriteBatch.Draw(projectileTexture, projectilePosition, null, 
-                Color.White, projectileRotation,
-                new Vector2(projectileTexture.Width / 2,
-                            projectileTexture.Height / 2),
-                1.0f, SpriteEffects.None, 0);
-
-            base.Draw(gameTime);
-        }
-        #endregion
-
-        #region Public functionality
-        /// <summary>
-        /// Helper function - calculates the projectile position and velocity based on time.
-        /// </summary>
-        /// <param name="gameTime">The time since last calculation</param>
-        public void UpdateProjectileFlightData(GameTime gameTime, float wind, float gravity, out bool groundHit)
-        {
-            flightTime += (float)gameTime.ElapsedGameTime.TotalSeconds;
-
-            // Calculate new projectile position using standard
-            // formulas, taking the wind as a force.
-            int direction = isAI ? -1 : 1;
-
-            float previousXPosition = projectilePosition.X;
-            float previousYPosition = projectilePosition.Y;
-
-            projectilePosition.X = projectileStartPosition.X + 
-                (direction * projectileVelocity.X * flightTime) + 
-                0.5f * (8 * wind * (float)Math.Pow(flightTime, 2));
-
-            projectilePosition.Y = projectileStartPosition.Y -
-                (projectileVelocity.Y * flightTime) +
-                0.5f * (gravity * (float)Math.Pow(flightTime, 2));            
-
-            // Calculate the projectile rotation
-            projectileRotation += MathHelper.ToRadians(projectileVelocity.X * 0.5f);
-
-            // Check if projectile hit the ground or even passed it 
-            // (could happen during normal calculation)
-            if (projectilePosition.Y >= 332 + hitOffset)
-            {
-                projectilePosition.X = previousXPosition;
-                projectilePosition.Y = previousYPosition;
-
-                ProjectileHitPosition = new Vector2(previousXPosition, 332);
-
-                groundHit = true;
-            }
-            else
-            {
-                groundHit = false;
-            }
-        }
-
-        public void Fire(float velocityX, float velocityY)
-        {
-            // Set initial projectile velocity
-            projectileVelocity.X = velocityX;
-            projectileVelocity.Y = velocityY;
-            projectileInitialVelocityY = projectileVelocity.Y;
-            // Reset calculation variables
-            flightTime = 0;
-        }
-        #endregion
-    }
-}

+ 0 - 84
CatapaultWars/CatapultGame.cs

@@ -1,84 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// CatapultGame.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Audio;
-using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.GamerServices;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input;
-using Microsoft.Xna.Framework.Input.Touch;
-using Microsoft.Xna.Framework.Media;
-using CatapultGame;
-using GameStateManagement;
-#endregion
-
-namespace CatapultGame
-{
-    /// <summary>
-    /// This is the main type for your game
-    /// </summary>
-    public class CatapultGame : Game
-    {
-        #region Fields
-        GraphicsDeviceManager graphics;
-        ScreenManager screenManager;
-        #endregion
-
-        #region Initialization Methods
-        public CatapultGame()
-        {
-            graphics = new GraphicsDeviceManager(this);
-			//graphics.SynchronizeWithVerticalRetrace = false;
-            Content.RootDirectory = "Content";
-
-            // Frame rate is 30 fps by default for Windows Phone.
-            TargetElapsedTime = TimeSpan.FromTicks(333333);
-
-            //Create a new instance of the Screen Manager
-            screenManager = new ScreenManager(this);
-            Components.Add(screenManager);
-			IsMouseVisible = true;
-#if !WINDOWS && !XBOX && !MONOMAC
-            //Switch to full screen for best game experience
-            graphics.IsFullScreen = true;
-#endif
-
-            //Add two new screens
-            screenManager.AddScreen(new BackgroundScreen(), null);
-            screenManager.AddScreen(new MainMenuScreen(), null);
-
-            AudioManager.Initialize(this);
-        }
-
-        /// <summary>
-        /// Allows the game to perform any initialization it needs to before starting to run.
-        /// This is where it can query for any required services and load any non-graphic
-        /// related content.  Calling base.Initialize will enumerate through any components
-        /// and initialize them as well.
-        /// </summary>
-        protected override void Initialize()
-        {
-            base.Initialize();
-        }
-        #endregion
-
-        #region Loading
-        protected override void LoadContent()
-        {
-            AudioManager.LoadSounds();
-            base.LoadContent();
-        }
-        #endregion
-    }
-}

+ 0 - 293
CatapaultWars/CatapultWars.Android.csproj

@@ -1,293 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{289A3AF8-E006-47EF-B34C-CA01020E1655}</ProjectGuid>
-    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Library</OutputType>
-    <RootNamespace>MonoGame.Samples.CatapultWars</RootNamespace>
-    <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
-    <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
-    <AndroidResgenClass>Resource</AndroidResgenClass>
-    <AndroidApplication>True</AndroidApplication>
-    <AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
-    <AssemblyName>MonoGame.Samples.CatapultWars</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;ANDROID</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <AndroidLinkMode>None</AndroidLinkMode>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
-    <ConsolePause>False</ConsolePause>
-    <AndroidLinkMode>SdkOnly</AndroidLinkMode>
-    <DefineConstants>ANDROID</DefineConstants>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="Mono.Android" />
-    <Reference Include="OpenTK" />
-    <Reference Include="System.Xml.Linq" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Activity1.cs" />
-    <Compile Include="Resources\Resource.designer.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="CatapultGame.cs">
-      <Link>CatapultGame.cs</Link>
-    </Compile>
-    <Compile Include="Catapult\Catapult.cs">
-      <Link>Catapult\Catapult.cs</Link>
-    </Compile>
-    <Compile Include="Catapult\Projectile.cs">
-      <Link>Catapult\Projectile.cs</Link>
-    </Compile>
-    <Compile Include="Players\AI.cs">
-      <Link>Players\AI.cs</Link>
-    </Compile>
-    <Compile Include="Players\Human.cs">
-      <Link>Players\Human.cs</Link>
-    </Compile>
-    <Compile Include="Players\Player.cs">
-      <Link>Players\Player.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\GameScreen.cs">
-      <Link>ScreenManager\GameScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\InputState.cs">
-      <Link>ScreenManager\InputState.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MenuEntry.cs">
-      <Link>ScreenManager\MenuEntry.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MenuScreen.cs">
-      <Link>ScreenManager\MenuScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MouseGestureType.cs">
-      <Link>ScreenManager\MouseGestureType.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\PlayerIndexEventArgs.cs">
-      <Link>ScreenManager\PlayerIndexEventArgs.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\ScreenManager.cs">
-      <Link>ScreenManager\ScreenManager.cs</Link>
-    </Compile>
-    <Compile Include="Screens\BackgroundScreen.cs">
-      <Link>Screens\BackgroundScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\GameplayScreen.cs">
-      <Link>Screens\GameplayScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\InstructionsScreen.cs">
-      <Link>Screens\InstructionsScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\MainMenuScreen.cs">
-      <Link>Screens\MainMenuScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\PauseScreen.cs">
-      <Link>Screens\PauseScreen.cs</Link>
-    </Compile>
-    <Compile Include="Utility\Animation.cs">
-      <Link>Utility\Animation.cs</Link>
-    </Compile>
-    <Compile Include="Utility\AudioManager.cs">
-      <Link>Utility\AudioManager.cs</Link>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Resources\AboutResources.txt" />
-    <None Include="Assets\AboutAssets.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <AndroidResource Include="Resources\layout\Main.axml" />
-    <AndroidResource Include="Resources\values\Strings.xml" />
-    <AndroidResource Include="Resources\drawable\Icon.png" />
-  </ItemGroup>
-  <Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
-  <ItemGroup>
-    <Folder Include="Assets\Content\" />
-    <Folder Include="Catapult\" />
-    <Folder Include="Players\" />
-    <Folder Include="ScreenManager\" />
-    <Folder Include="Screens\" />
-    <Folder Include="Utility\" />
-    <Folder Include="Assets\Content\Fonts\" />
-    <Folder Include="Assets\Content\Sounds\" />
-    <Folder Include="Assets\Content\Textures\" />
-    <Folder Include="Assets\Content\Textures\Ammo\" />
-    <Folder Include="Assets\Content\Textures\Backgrounds\" />
-    <Folder Include="Assets\Content\Textures\Catapults\" />
-    <Folder Include="Assets\Content\Textures\HUD\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Blue\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Fire_Miss\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Hit_Smoke\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Red\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Blue\blueDestroyed\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Blue\blueFire\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Blue\blueIdle\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Blue\bluePullback\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Red\redDestroyed\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Red\redFire\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Red\redIdle\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Red\redPullback\" />
-  </ItemGroup>
-  <ItemGroup>
-    <AndroidAsset Include="Content\Fonts\HUDFont.xnb">
-      <Link>Assets\Content\Fonts\HUDFont.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Fonts\MenuFont.xnb">
-      <Link>Assets\Content\Fonts\MenuFont.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Ammo\rock_ammo.xnb">
-      <Link>Assets\Content\Textures\Ammo\rock_ammo.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\blank.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\blank.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\cloud1.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\cloud1.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\cloud2.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\cloud2.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\defeat.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\defeat.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\gameplay_screen.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\gameplay_screen.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\instructions.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\instructions.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\mountain.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\mountain.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\sky.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\sky.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\title_screen.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\title_screen.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\victory.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\victory.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\HUD\ammoType.xnb">
-      <Link>Assets\Content\Textures\HUD\ammoType.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\HUD\Arrow.xnb">
-      <Link>Assets\Content\Textures\HUD\Arrow.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\HUD\hudBackground.xnb">
-      <Link>Assets\Content\Textures\HUD\hudBackground.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\HUD\windArrow.xnb">
-      <Link>Assets\Content\Textures\HUD\windArrow.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\AnimationsDef.xml">
-      <Link>Assets\Content\Textures\Catapults\AnimationsDef.xml</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb">
-      <Link>Assets\Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb">
-      <Link>Assets\Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb">
-      <Link>Assets\Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb">
-      <Link>Assets\Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb">
-      <Link>Assets\Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb">
-      <Link>Assets\Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Red\redIdle\redIdle.xnb">
-      <Link>Assets\Content\Textures\Catapults\Red\redIdle\redIdle.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb">
-      <Link>Assets\Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\BoulderHit.wav">
-      <Link>Assets\Content\Sounds\BoulderHit.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\CatapultExplosion.wav">
-      <Link>Assets\Content\Sounds\CatapultExplosion.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\CatapultFire.wav">
-      <Link>Assets\Content\Sounds\CatapultFire.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\Lose.wav">
-      <Link>Assets\Content\Sounds\Lose.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\RopeStretch.wav">
-      <Link>Assets\Content\Sounds\RopeStretch.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\Win.wav">
-      <Link>Assets\Content\Sounds\Win.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Fire_Miss\fire_miss.xnb">
-      <Link>Assets\Content\Textures\Catapults\Fire_Miss\fire_miss.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Hit_Smoke\smoke.xnb">
-      <Link>Assets\Content\Textures\Catapults\Hit_Smoke\smoke.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </AndroidAsset>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\ThirdParty\Lidgren.Network\Lidgren.Network.Android.csproj">
-      <Project>{565129E0-4EE5-4F6F-B403-C3484C9740BE}</Project>
-      <Name>Lidgren.Network.Android</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\MonoGame.Framework\MonoGame.Framework.Android.csproj">
-      <Project>{BA9476CF-99BA-4D03-92F2-73D2C5E58883}</Project>
-      <Name>MonoGame.Framework.Android</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>

+ 0 - 244
CatapaultWars/CatapultWars.iOS.csproj

@@ -1,244 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}</ProjectGuid>
-    <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>Catapults</RootNamespace>
-    <AssemblyName>Catapults</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
-    <DefineConstants>DEBUG; IPHONE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <MtouchDebug>True</MtouchDebug>
-    <MtouchProfiling>True</MtouchProfiling>
-    <MtouchLink>None</MtouchLink>
-    <MtouchI18n />
-    <MtouchArch>ARMv7</MtouchArch>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <MtouchLink>None</MtouchLink>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhone\Debug</OutputPath>
-    <DefineConstants>DEBUG;</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <CodesignKey>iPhone Developer</CodesignKey>
-    <MtouchDebug>True</MtouchDebug>
-    <MtouchProfiling>True</MtouchProfiling>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhone\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <CodesignKey>iPhone Developer</CodesignKey>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="monotouch" />
-    <Reference Include="OpenTK" />
-    <Reference Include="System.Xml.Linq" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Info.iOS.plist">
-      <Link>Info.plist</Link>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="CatapultGame.cs">
-      <Link>CatapultGame.cs</Link>
-    </Compile>
-    <Compile Include="Catapult\Catapult.cs">
-      <Link>Catapult\Catapult.cs</Link>
-    </Compile>
-    <Compile Include="Catapult\Projectile.cs">
-      <Link>Catapult\Projectile.cs</Link>
-    </Compile>
-    <Compile Include="Players\AI.cs">
-      <Link>Players\AI.cs</Link>
-    </Compile>
-    <Compile Include="Players\Human.cs">
-      <Link>Players\Human.cs</Link>
-    </Compile>
-    <Compile Include="Players\Player.cs">
-      <Link>Players\Player.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\GameScreen.cs">
-      <Link>ScreenManager\GameScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\InputState.cs">
-      <Link>ScreenManager\InputState.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MenuEntry.cs">
-      <Link>ScreenManager\MenuEntry.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MenuScreen.cs">
-      <Link>ScreenManager\MenuScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MouseGestureType.cs">
-      <Link>ScreenManager\MouseGestureType.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\PlayerIndexEventArgs.cs">
-      <Link>ScreenManager\PlayerIndexEventArgs.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\ScreenManager.cs">
-      <Link>ScreenManager\ScreenManager.cs</Link>
-    </Compile>
-    <Compile Include="Screens\BackgroundScreen.cs">
-      <Link>Screens\BackgroundScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\GameplayScreen.cs">
-      <Link>Screens\GameplayScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\InstructionsScreen.cs">
-      <Link>Screens\InstructionsScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\MainMenuScreen.cs">
-      <Link>Screens\MainMenuScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\PauseScreen.cs">
-      <Link>Screens\PauseScreen.cs</Link>
-    </Compile>
-    <Compile Include="Utility\Animation.cs">
-      <Link>Utility\Animation.cs</Link>
-    </Compile>
-    <Compile Include="Utility\AudioManager.cs">
-      <Link>Utility\AudioManager.cs</Link>
-    </Compile>
-    <Compile Include="Program.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <ItemGroup>
-    <Content Include="Background.png">
-      <Link>Background.png</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\blank.xnb">
-      <Link>Content\Textures\Backgrounds\blank.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\cloud1.xnb">
-      <Link>Content\Textures\Backgrounds\cloud1.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\cloud2.xnb">
-      <Link>Content\Textures\Backgrounds\cloud2.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\defeat.xnb">
-      <Link>Content\Textures\Backgrounds\defeat.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\gameplay_screen.xnb">
-      <Link>Content\Textures\Backgrounds\gameplay_screen.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\instructions.xnb">
-      <Link>Content\Textures\Backgrounds\instructions.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\mountain.xnb">
-      <Link>Content\Textures\Backgrounds\mountain.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\sky.xnb">
-      <Link>Content\Textures\Backgrounds\sky.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\title_screen.xnb">
-      <Link>Content\Textures\Backgrounds\title_screen.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\victory.xnb">
-      <Link>Content\Textures\Backgrounds\victory.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\HUD\ammoType.xnb">
-      <Link>Content\Textures\HUD\ammoType.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\HUD\Arrow.xnb">
-      <Link>Content\Textures\HUD\Arrow.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\HUD\hudBackground.xnb">
-      <Link>Content\Textures\HUD\hudBackground.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\HUD\windArrow.xnb">
-      <Link>Content\Textures\HUD\windArrow.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\AnimationsDef.xml">
-      <Link>Content\Textures\Catapults\AnimationsDef.xml</Link>
-    </Content>
-    <Content Include="Content\Sounds\BoulderHit.xnb">
-      <Link>Content\Sounds\BoulderHit.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\CatapultExplosion.xnb">
-      <Link>Content\Sounds\CatapultExplosion.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\CatapultFire.xnb">
-      <Link>Content\Sounds\CatapultFire.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\Lose.xnb">
-      <Link>Content\Sounds\Lose.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\RopeStretch.xnb">
-      <Link>Content\Sounds\RopeStretch.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\Win.xnb">
-      <Link>Content\Sounds\Win.xnb</Link>
-    </Content>
-    <Content Include="Content\Fonts\MenuFont.xnb">
-      <Link>Content\Fonts\MenuFont.xnb</Link>
-    </Content>
-    <Content Include="Content\Fonts\HUDFont.xnb">
-      <Link>Content\Fonts\HUDFont.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb">
-      <Link>Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb">
-      <Link>Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb">
-      <Link>Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb">
-      <Link>Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Fire_Miss\fire_miss.xnb">
-      <Link>Content\Textures\Catapults\Fire_Miss\fire_miss.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Hit_Smoke\smoke.xnb">
-      <Link>Content\Textures\Catapults\Hit_Smoke\smoke.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb">
-      <Link>Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb">
-      <Link>Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redIdle\redIdle.xnb">
-      <Link>Content\Textures\Catapults\Red\redIdle\redIdle.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb">
-      <Link>Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Ammo\rock_ammo.xnb">
-      <Link>Content\Textures\Ammo\rock_ammo.xnb</Link>
-    </Content>
-  </ItemGroup>
-</Project>

+ 0 - 63
CatapaultWars/Content/Textures/Catapults/AnimationsDef.xml

@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<Animations>
-  <!--Player animation definitions-->
-  <Definition FrameWidth="75" FrameHeight="60"
-              SheetRows="2" SheetColumns="15"
-              Speed="30" SplitFrame="20"
-              SheetName="Textures/Catapults/Blue/blueFire/blueCatapult_fire"
-              Alias="Fire" IsAI="false"/>
-  <Definition FrameWidth="75" FrameHeight="60"
-              SheetRows="1" SheetColumns="18"
-              Speed="30"
-              SheetName="Textures/Catapults/Blue/bluePullback/blueCatapult_Pullback"
-              Alias="Aim" IsAI="false"/>
-
-  <Definition FrameWidth="122" FrameHeight="62"
-              SheetRows="2" SheetColumns="15"
-              Speed="30" OffsetX="-40" OffsetY="0"
-              SheetName="Textures/Catapults/Blue/blueDestroyed/blueCatapult_destroyed"
-              Alias="Destroyed" IsAI="false"/>
-
-    <Definition FrameWidth="90" FrameHeight="80"
-           SheetRows="2" SheetColumns="15"
-           Speed="30" OffsetX="-50" OffsetY="0"
-           SheetName="Textures/Catapults/Fire_Miss/fire_miss"
-           Alias="fireMiss" IsAI="false"/>
-
-    <Definition FrameWidth="128" FrameHeight="128"
-           SheetRows="2" SheetColumns="15"
-           Speed="30" OffsetX="0" OffsetY="-64"
-           SheetName="Textures/Catapults/Hit_Smoke/smoke"
-           Alias="hitSmoke" IsAI="false"/>
-
-    <!--AI animation definitions-->
-  <Definition FrameWidth="75" FrameHeight="60"
-            SheetRows="2" SheetColumns="15"
-            Speed="30" SplitFrame="20"
-            SheetName="Textures/Catapults/Red/redFire/redCatapult_fire"
-            Alias="Fire" IsAI="true"/>
-  <Definition FrameWidth="122" FrameHeight="62"
-              SheetRows="2" SheetColumns="15"
-              Speed="30" OffsetX="-11" OffsetY="0"
-              SheetName="Textures/Catapults/Red/redDestroyed/redCatapult_destroyed"
-              Alias="Destroyed" IsAI="true"/>
-
-  <Definition FrameWidth="75" FrameHeight="60"
-            SheetRows="1" SheetColumns="18"
-            Speed="30"
-            SheetName="Textures/Catapults/Red/redPullback/redCatapult_Pullback"
-            Alias="Aim" IsAI="true"/>
-
-    <Definition FrameWidth="90" FrameHeight="80"
-           SheetRows="2" SheetColumns="15"
-           Speed="30" OffsetX="-50" OffsetY="0"
-           SheetName="Textures/Catapults/Fire_Miss/fire_miss"
-           Alias="fireMiss" IsAI="true"/>
-
-    <Definition FrameWidth="128" FrameHeight="128"
-           SheetRows="2" SheetColumns="15"
-           Speed="30" OffsetX="-30" OffsetY="-64"
-           SheetName="Textures/Catapults/Hit_Smoke/smoke"
-           Alias="hitSmoke" IsAI="true"/> 
-</Animations>
-

+ 0 - 79
CatapaultWars/Players/AI.cs

@@ -1,79 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// AI.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region File Information
-//-----------------------------------------------------------------------------
-// AI.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-#endregion
-
-namespace CatapultGame
-{
-    class AI : Player
-    {
-        #region Fields
-        Random random;
-        #endregion
-
-        #region Initialization
-        public AI(Game game)
-            : base(game)
-        {
-        }
-
-        public AI(Game game, SpriteBatch screenSpriteBatch)
-            : base(game, screenSpriteBatch)
-        {
-            Catapult = new Catapult(game, screenSpriteBatch,
-                            "Textures/Catapults/Red/redIdle/redIdle",
-                            new Vector2(600, 332), SpriteEffects.FlipHorizontally, true);
-        }
-
-        public override void Initialize()
-        {
-            //Initialize randomizer
-            random = new Random();
-
-            Catapult.Initialize();
-
-            base.Initialize();
-        }
-        #endregion
-
-        #region Update
-        public override void Update(GameTime gameTime)
-        {
-            // Check if it is time to take a shot
-            if (Catapult.CurrentState == CatapultState.Aiming &&
-                !Catapult.AnimationRunning)
-            {
-                // Fire at a random strength
-                float shotVelocity =
-                    random.Next((int)MinShotStrength, (int)MaxShotStrength);
-
-                Catapult.ShotStrength = (shotVelocity / MaxShotStrength);
-                Catapult.ShotVelocity = shotVelocity;
-            }
-            base.Update(gameTime);
-        }
-        #endregion
-    }
-}

+ 0 - 195
CatapaultWars/Players/Human.cs

@@ -1,195 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// Human.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region File Information
-//-----------------------------------------------------------------------------
-// Human.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input.Touch;
-using Microsoft.Xna.Framework.Input;
-using GameStateManagement;
-
-#endregion
-
-
-namespace CatapultGame
-{
-	class Human : Player
-	{
-        #region Fields/Constants
-		// Drag variables to hold first and last gesture samples
-		GestureSample? prevSample;
-		GestureSample? firstSample;
-
-		public bool isDragging { get; set; }
-		// Constant for longest distance possible between drag points
-		readonly float maxDragDelta = (new Vector2 (480, 800)).Length ();
-		// Textures & position & spriteEffects used for Catapult
-		Texture2D arrow;
-		float arrowScale;
-		Vector2 catapultPosition = new Vector2 (140, 332);
-        #endregion
-
-        #region Initialization
-		public Human (Game game)
-            : base(game)
-		{
-		}
-
-		public Human (Game game, SpriteBatch screenSpriteBatch)
-            : base(game, screenSpriteBatch)
-		{
-			Catapult = new Catapult (game, screenSpriteBatch,
-                                    "Textures/Catapults/Blue/blueIdle/blueIdle",
-                                    catapultPosition, SpriteEffects.None, false);
-		}
-
-		public override void Initialize ()
-		{
-			arrow = curGame.Content.Load<Texture2D> ("Textures/HUD/Arrow");
-
-			Catapult.Initialize ();
-
-			base.Initialize ();
-		}
-        #endregion
-
-        #region Handle Input
-		/// <summary>
-		/// Function processes the user input
-		/// </summary>
-		/// <param name="gestureSample"></param>
-		public void HandleInput (GestureSample gestureSample)
-		{
-			// Process input only if in Human's turn
-			if (IsActive) {
-				// Process any Drag gesture
-				if (gestureSample.GestureType == GestureType.FreeDrag) {
-					// If drag just began save the sample for future
-					// calculations and start Aim "animation"
-					if (null == firstSample) {
-						firstSample = gestureSample;
-						Catapult.CurrentState = CatapultState.Aiming;
-					}
-
-					// save the current gesture sample
-					prevSample = gestureSample;
-
-					// calculate the delta between first sample and current
-					// sample to present visual sound on screen
-					Vector2 delta = prevSample.Value.Position - firstSample.Value.Position;
-					Catapult.ShotStrength = delta.Length () / maxDragDelta;
-					float baseScale = 0.001f;
-					arrowScale = baseScale * delta.Length ();
-					isDragging = true;
-				} else if (gestureSample.GestureType == GestureType.DragComplete) {
-					// calc velocity based on delta between first and last
-					// gesture samples
-					if (null != firstSample) {
-						Vector2 delta = prevSample.Value.Position - firstSample.Value.Position;
-						Catapult.ShotVelocity = MinShotStrength + Catapult.ShotStrength *
-									(MaxShotStrength - MinShotStrength);
-						Catapult.Fire (Catapult.ShotVelocity);
-						Catapult.CurrentState = CatapultState.Firing;
-					}
-
-					// turn off dragging state
-					ResetDragState ();
-				}
-			}
-		}
-
-		Vector2? firstMouseSample = null;
-		Vector2? prevMouseSample = null;
-
-		public void HandleInput (InputState input)
-		{
-			// Process input only if in Human's turn
-			if (IsActive) {
-
-				if (input.MouseGesture.HasFlag(MouseGestureType.FreeDrag)) {
-					// If drag just began save the sample for future
-					// calculations and start Aim "animation"
-					if (null == firstMouseSample) {
-						firstMouseSample = input.MouseDragStartPosition;
-						Catapult.CurrentState = CatapultState.Aiming;
-					}
-
-					// save the current gesture sample
-					prevMouseSample = input.CurrentMousePosition;
-
-					// calculate the delta between first sample and current
-					// sample to present visual sound on screen
-					Vector2 delta = (Vector2)prevMouseSample - (Vector2)firstMouseSample;
-					Catapult.ShotStrength = delta.Length () / maxDragDelta;
-					float baseScale = 0.001f;
-					arrowScale = baseScale * delta.Length ();
-					isDragging = true;
-				} else if (input.MouseGesture.HasFlag(MouseGestureType.DragComplete)) {
-					// calc velocity based on delta between first and last
-					// gesture samples
-					if (null != firstMouseSample) {
-						Vector2 delta = (Vector2)prevMouseSample - (Vector2)firstMouseSample;
-						Catapult.ShotVelocity = MinShotStrength + Catapult.ShotStrength *
-						    (MaxShotStrength - MinShotStrength);
-						Catapult.Fire (Catapult.ShotVelocity);
-						Catapult.CurrentState = CatapultState.Firing;
-					}
-
-					ResetDragState ();
-				}
-			}
-		}
-
-        #endregion
-
-        #region Draw
-		public override void Draw (GameTime gameTime)
-		{
-			if (isDragging)
-				DrawDragArrow (arrowScale);
-
-			base.Draw (gameTime);
-		}
-
-		public void DrawDragArrow (float arrowScale)
-		{
-			spriteBatch.Draw (arrow, catapultPosition + new Vector2 (0, -40),
-              null, Color.Blue, 0,
-              Vector2.Zero, new Vector2 (arrowScale, 0.1f), SpriteEffects.None, 0);
-		}
-        #endregion
-
-		/// <summary>
-		/// Turn off dragging state and reset drag related variables
-		/// </summary>
-		public void ResetDragState ()
-		{
-			firstSample = null;
-			prevSample = null;
-			firstMouseSample = null;
-			prevMouseSample = null;
-			isDragging = false;
-			arrowScale = 0;
-			Catapult.ShotStrength = 0;
-		}
-	}
-}

+ 0 - 94
CatapaultWars/Players/Player.cs

@@ -1,94 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// Player.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region File Information
-//-----------------------------------------------------------------------------
-// Player.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-#endregion
-
-namespace CatapultGame
-{
-    internal class Player : DrawableGameComponent
-    {
-        #region Variables/Fields
-        protected CatapultGame curGame;
-        protected SpriteBatch spriteBatch;
-
-        // Constants used for calculating shot strength
-        public const float MinShotStrength = 150;
-        public const float MaxShotStrength = 400;
-
-        // Public variables used by Gameplay class
-        public Catapult Catapult { get; set; }
-        public int Score { get; set; }
-        public string Name { get; set; }
-
-        public Player Enemy
-        {
-            set
-            {
-                Catapult.Enemy = value;
-                Catapult.Self = this;
-            }
-        }
-
-        public bool IsActive { get; set; }
-        #endregion
-
-        #region Initialization
-        public Player(Game game)
-            : base(game)
-        {
-            curGame = (CatapultGame)game;
-        }
-
-        public Player(Game game, SpriteBatch screenSpriteBatch)
-            : this(game)
-        {
-            spriteBatch = screenSpriteBatch;
-        }
-
-        public override void Initialize()
-        {
-            Score = 0;
-
-            base.Initialize();
-        }
-        #endregion
-
-        #region Update and Render
-        public override void Update(GameTime gameTime)
-        {
-            // Update catapult related to the player
-            Catapult.Update(gameTime);
-            base.Update(gameTime);
-        }
-
-        public override void Draw(GameTime gameTime)
-        {
-            // Draw related catapults
-            Catapult.Draw(gameTime);
-            base.Draw(gameTime);
-        }
-        #endregion
-    }
-}

+ 0 - 94
CatapaultWars/Program.cs

@@ -1,94 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// Program.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-
-#if IPHONE
-using MonoTouch.Foundation;
-using MonoTouch.UIKit;
-#endif
-
-#endregion
-
-namespace CatapultGame
-{
-#if WINDOWS || XBOX
-    static class Program
-    {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        static void Main(string[] args)
-        {
-            using (CatapultGame game = new CatapultGame())
-            {
-                game.Run();
-            }
-        }
-    }
-#elif MONOMAC
-
-
-	static class Program
-	{	
-		/// <summary>
-		/// The main entry point for the application.
-		/// </summary>
-		static void Main (string[] args)
-		{
-			MonoMac.AppKit.NSApplication.Init ();
-			
-			using (var p = new MonoMac.Foundation.NSAutoreleasePool ()) {
-				MonoMac.AppKit.NSApplication.SharedApplication.Delegate = new AppDelegate();
-				MonoMac.AppKit.NSApplication.Main(args);
-			}
-		}
-	}
-	
-	class AppDelegate : MonoMac.AppKit.NSApplicationDelegate
-	{
-		CatapultGame game;
-		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
-		{
-			CatapultGame game = new CatapultGame();
-			game.Run ();
-
-		}
-		
-		public override bool ApplicationShouldTerminateAfterLastWindowClosed (MonoMac.AppKit.NSApplication sender)
-		{
-			return true;
-		}
-	}
-#elif IPHONE
-	[Register ("AppDelegate")]
-	class Program : UIApplicationDelegate 
-	{
-		private CatapultGame game;
-
-		public override void FinishedLaunching (UIApplication app)
-		{
-			// Fun begins..
-			game = new CatapultGame();
-			game.Run();
-		}
-		
-		// This is the main entry point of the application.
-		static void Main (string[] args)
-		{
-			// if you want to use a different Application Delegate class from "AppDelegate"
-			// you can specify it here.
-			UIApplication.Main (args, null, "AppDelegate");
-		}
-	}
-#endif
-
-}
-

+ 0 - 28
CatapaultWars/Properties/AssemblyInfo.cs

@@ -1,28 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using Android.App;
-
-// Information about this assembly is defined by the following attributes. 
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle("MonoGame.Samples.CatapultWars")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("technomage")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion("1.0.0")]
-
-// The following attributes are used to specify the signing key for the assembly, 
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]
-

+ 0 - 73
CatapaultWars/Resources/Resource.designer.cs

@@ -1,73 +0,0 @@
-#pragma warning disable 1591
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.586
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-[assembly: Android.Runtime.ResourceDesignerAttribute("MonoGame.Samples.CatapultWars.Resource", IsApplication=true)]
-
-namespace MonoGame.Samples.CatapultWars
-{
-	
-	
-	[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
-	public partial class Resource
-	{
-		
-		Resource()
-		{
-			global::Android.Runtime.ResourceIdManager.UpdateIdValues ();
-		}
-		
-		public static void UpdateIdValues()
-		{
-		}
-		
-		public partial class Attribute
-		{
-			
-			private Attribute()
-			{
-			}
-		}
-		
-		public partial class Drawable
-		{
-			
-			// aapt resource value: 0x7f020000
-			public const int Icon = 2130837504;
-			
-			private Drawable()
-			{
-			}
-		}
-		
-		public partial class Layout
-		{
-			
-			// aapt resource value: 0x7f030000
-			public const int Main = 2130903040;
-			
-			private Layout()
-			{
-			}
-		}
-		
-		public partial class String
-		{
-			
-			// aapt resource value: 0x7f040000
-			public const int app_name = 2130968576;
-			
-			private String()
-			{
-			}
-		}
-	}
-}
-#pragma warning restore 1591

二進制
CatapaultWars/Resources/drawable/Icon.png


+ 0 - 8
CatapaultWars/Resources/layout/Main.axml

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-</LinearLayout>
-

+ 0 - 4
CatapaultWars/Resources/values/Strings.xml

@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-	<string name="app_name">MonoGame.Samples.CatapultWars</string>
-</resources>

+ 0 - 347
CatapaultWars/ScreenManager/InputState.cs

@@ -1,347 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// InputState.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Input;
-using Microsoft.Xna.Framework.Input.Touch;
-#endregion
-
-namespace GameStateManagement
-{
-	/// <summary>
-	/// Helper for reading input from keyboard, gamepad, and touch input. This class 
-	/// tracks both the current and previous state of the input devices, and implements 
-	/// query methods for high level input actions such as "move up through the menu"
-	/// or "pause the game".
-	/// </summary>
-	public class InputState
-	{
-        #region Fields
-
-		public const int MaxInputs = 4;
-		public readonly KeyboardState[] CurrentKeyboardStates;
-		public readonly GamePadState[] CurrentGamePadStates;
-		public readonly KeyboardState[] LastKeyboardStates;
-		public readonly GamePadState[] LastGamePadStates;
-		public readonly bool[] GamePadWasConnected;
-		public TouchCollection TouchState;
-		public MouseState CurrentMouseState;
-		public MouseState LastMouseState;
-		public readonly List<GestureSample> Gestures = new List<GestureSample> ();
-
-        #endregion
-
-        #region Initialization
-
-
-		/// <summary>
-		/// Constructs a new input state.
-		/// </summary>
-		public InputState ()
-		{
-			CurrentKeyboardStates = new KeyboardState[MaxInputs];
-			CurrentGamePadStates = new GamePadState[MaxInputs];
-
-			LastKeyboardStates = new KeyboardState[MaxInputs];
-			LastGamePadStates = new GamePadState[MaxInputs];
-
-			GamePadWasConnected = new bool[MaxInputs];
-		}
-
-
-        #endregion
-
-        #region Public Methods
-
-
-		/// <summary>
-		/// Reads the latest state of the keyboard and gamepad.
-		/// </summary>
-		public void Update ()
-		{
-			for (int i = 0; i < MaxInputs; i++) {
-				LastKeyboardStates [i] = CurrentKeyboardStates [i];
-				LastGamePadStates [i] = CurrentGamePadStates [i];
-
-				CurrentKeyboardStates [i] = Keyboard.GetState ((PlayerIndex)i);
-				CurrentGamePadStates [i] = GamePad.GetState ((PlayerIndex)i);
-
-				// Keep track of whether a gamepad has ever been
-				// connected, so we can detect if it is unplugged.
-				if (CurrentGamePadStates [i].IsConnected) {
-					GamePadWasConnected [i] = true;
-				}
-			}
-
-			TouchState = TouchPanel.GetState ();
-
-			LastMouseState = CurrentMouseState;
-			CurrentMouseState = Mouse.GetState ();
-
-			UpdateMouseStates();
-
-			Gestures.Clear ();
-			while (TouchPanel.IsGestureAvailable) {
-				Gestures.Add (TouchPanel.ReadGesture ());
-			}
-		}
-
-		bool dragging = false;
-		bool dragComplete = false;
-		bool leftMouseDown = false;
-		int dragThreshold = 3;
-		MouseGestureType mouseGestureType;
-		Vector2 currentMousePosition = Vector2.Zero;
-		Vector2 prevMousePosition = Vector2.Zero;
-		Vector2 dragMouseStart = Vector2.Zero;
-		Vector2 dragMouseEnd = Vector2.Zero;
-
-		public MouseGestureType MouseGesture
-		{
-			get {
-				return mouseGestureType;
-			}
-		}
-
-		public Vector2 CurrentMousePosition
-		{
-			get {
-				return currentMousePosition;
-			}
-		}
-
-		public Vector2 PrevMousePosition
-		{
-			get {
-				return prevMousePosition;
-			}
-		}
-
-		public Vector2 MouseDelta
-		{
-			get {
-				return prevMousePosition - currentMousePosition;
-			}
-		}
-
-		public Vector2 MouseDragDelta
-		{
-			get {
-				return dragMouseStart - dragMouseEnd;
-			}
-		}
-
-		public Vector2 MouseDragStartPosition
-		{
-			get {
-				return dragMouseStart;
-			}
-		}
-
-		public Vector2 MouseDragEndPosition
-		{
-			get {
-				return dragMouseEnd;
-			}
-		}
-
-		void UpdateMouseStates ()
-		{
-			currentMousePosition.X = CurrentMouseState.X;
-			currentMousePosition.Y = CurrentMouseState.Y;
-
-			prevMousePosition.X = LastMouseState.X;
-			prevMousePosition.Y = LastMouseState.Y;
-
-			if (mouseGestureType.HasFlag(MouseGestureType.LeftClick))
-				mouseGestureType = mouseGestureType ^ MouseGestureType.LeftClick;
-
-			if (mouseGestureType.HasFlag(MouseGestureType.Move))
-				mouseGestureType = mouseGestureType ^ MouseGestureType.Move;
-
-			if (MouseDelta.Length() != 0)
-				mouseGestureType = mouseGestureType | MouseGestureType.Move;
-
-			// If we were dragging and the left mouse button was released
-			// then we are no longer dragging and need to throw the banana.
-			if (CurrentMouseState.LeftButton == ButtonState.Released &&
-					dragging) {
-
-				leftMouseDown = false;
-				dragging = false;
-				dragComplete = true;
-				dragMouseEnd = currentMousePosition;
-				mouseGestureType |= MouseGestureType.DragComplete;
-				mouseGestureType = mouseGestureType ^ MouseGestureType.FreeDrag;
-				//Console.WriteLine ("Dragging: " + mouseGestureType);
-
-			}
-
-			// Let's set the left mouse down and the mouse origin
-			if (!leftMouseDown && CurrentMouseState.LeftButton == ButtonState.Pressed &&
-					!CurrentMouseState.Equals (LastMouseState)) {
-				//Console.WriteLine ("left down");
-				leftMouseDown = true;
-				dragComplete = false;
-				dragMouseStart = currentMousePosition;
-			}
-
-			if (leftMouseDown && CurrentMouseState.LeftButton == ButtonState.Released &&
-					!CurrentMouseState.Equals (LastMouseState)) {
-				leftMouseDown = false;
-				mouseGestureType |= MouseGestureType.LeftClick;
-			}
-
-			// Here we test the distance and if over the threshold then we set the dragging to true
-			//  Current threshold is 5 pixels.
-			if (leftMouseDown && !dragging) {
-
-				Vector2 delta = dragMouseStart - currentMousePosition;
-
-				if (delta.Length() > dragThreshold) {
-					dragging = true;
-					dragMouseStart = currentMousePosition;
-					mouseGestureType = mouseGestureType | MouseGestureType.FreeDrag;
-					//Console.WriteLine ("Dragging: " + mouseGestureType);
-				}
-			}
-
-			//Console.WriteLine(mouseGestureType);
-		}
-
-		/// <summary>
-		/// Helper for checking if a key was newly pressed during this update. The
-		/// controllingPlayer parameter specifies which player to read input for.
-		/// If this is null, it will accept input from any player. When a keypress
-		/// is detected, the output playerIndex reports which player pressed it.
-		/// </summary>
-		public bool IsNewKeyPress (Keys key, PlayerIndex? controllingPlayer, out PlayerIndex playerIndex)
-		{
-			if (controllingPlayer.HasValue) {
-				// Read input from the specified player.
-				playerIndex = controllingPlayer.Value;
-
-				int i = (int)playerIndex;
-
-				return (CurrentKeyboardStates [i].IsKeyDown (key) && LastKeyboardStates [i].IsKeyUp (key));
-			} else {
-				// Accept input from any player.
-				return (IsNewKeyPress (key, PlayerIndex.One, out playerIndex) ||
-					IsNewKeyPress (key, PlayerIndex.Two, out playerIndex) ||
-					IsNewKeyPress (key, PlayerIndex.Three, out playerIndex) ||
-					IsNewKeyPress (key, PlayerIndex.Four, out playerIndex));
-			}
-		}
-
-
-		/// <summary>
-		/// Helper for checking if a button was newly pressed during this update.
-		/// The controllingPlayer parameter specifies which player to read input for.
-		/// If this is null, it will accept input from any player. When a button press
-		/// is detected, the output playerIndex reports which player pressed it.
-		/// </summary>
-		public bool IsNewButtonPress (Buttons button, PlayerIndex? controllingPlayer, out PlayerIndex playerIndex)
-		{
-			if (controllingPlayer.HasValue) {
-				// Read input from the specified player.
-				playerIndex = controllingPlayer.Value;
-
-				int i = (int)playerIndex;
-
-				return (CurrentGamePadStates [i].IsButtonDown (button) && LastGamePadStates [i].IsButtonUp (button));
-			} else {
-				// Accept input from any player.
-				return (IsNewButtonPress (button, PlayerIndex.One, out playerIndex) ||
-					IsNewButtonPress (button, PlayerIndex.Two, out playerIndex) ||
-					IsNewButtonPress (button, PlayerIndex.Three, out playerIndex) ||
-					IsNewButtonPress (button, PlayerIndex.Four, out playerIndex));
-			}
-		}
-
-
-		/// <summary>
-		/// Checks for a "menu select" input action.
-		/// The controllingPlayer parameter specifies which player to read input for.
-		/// If this is null, it will accept input from any player. When the action
-		/// is detected, the output playerIndex reports which player pressed it.
-		/// </summary>
-		public bool IsMenuSelect (PlayerIndex? controllingPlayer, out PlayerIndex playerIndex)
-		{
-			return IsNewKeyPress (Keys.Space, controllingPlayer, out playerIndex) ||
-						IsNewKeyPress (Keys.Enter, controllingPlayer, out playerIndex) ||
-						IsNewButtonPress (Buttons.A, controllingPlayer, out playerIndex) ||
-						IsNewButtonPress (Buttons.Start, controllingPlayer, out playerIndex);
-		}
-
-
-		/// <summary>
-		/// Checks for a "menu cancel" input action.
-		/// The controllingPlayer parameter specifies which player to read input for.
-		/// If this is null, it will accept input from any player. When the action
-		/// is detected, the output playerIndex reports which player pressed it.
-		/// </summary>
-		public bool IsMenuCancel (PlayerIndex? controllingPlayer, out PlayerIndex playerIndex)
-		{
-			return IsNewKeyPress (Keys.Escape, controllingPlayer, out playerIndex) ||
-						IsNewButtonPress (Buttons.B, controllingPlayer, out playerIndex) ||
-						IsNewButtonPress (Buttons.Back, controllingPlayer, out playerIndex);
-		}
-
-
-		/// <summary>
-		/// Checks for a "menu up" input action.
-		/// The controllingPlayer parameter specifies which player to read
-		/// input for. If this is null, it will accept input from any player.
-		/// </summary>
-		public bool IsMenuUp (PlayerIndex? controllingPlayer)
-		{
-			PlayerIndex playerIndex;
-
-			return IsNewKeyPress (Keys.Up, controllingPlayer, out playerIndex) ||
-						IsNewButtonPress (Buttons.DPadUp, controllingPlayer, out playerIndex) ||
-						IsNewButtonPress (Buttons.LeftThumbstickUp, controllingPlayer, out playerIndex);
-		}
-
-
-		/// <summary>
-		/// Checks for a "menu down" input action.
-		/// The controllingPlayer parameter specifies which player to read
-		/// input for. If this is null, it will accept input from any player.
-		/// </summary>
-		public bool IsMenuDown (PlayerIndex? controllingPlayer)
-		{
-			PlayerIndex playerIndex;
-
-			return IsNewKeyPress (Keys.Down, controllingPlayer, out playerIndex) ||
-						IsNewButtonPress (Buttons.DPadDown, controllingPlayer, out playerIndex) ||
-						IsNewButtonPress (Buttons.LeftThumbstickDown, controllingPlayer, out playerIndex);
-		}
-
-
-		/// <summary>
-		/// Checks for a "pause the game" input action.
-		/// The controllingPlayer parameter specifies which player to read
-		/// input for. If this is null, it will accept input from any player.
-		/// </summary>
-		public bool IsPauseGame (PlayerIndex? controllingPlayer)
-		{
-			PlayerIndex playerIndex;
-
-			return IsNewKeyPress (Keys.Escape, controllingPlayer, out playerIndex) ||
-						IsNewButtonPress (Buttons.Back, controllingPlayer, out playerIndex) ||
-						IsNewButtonPress (Buttons.Start, controllingPlayer, out playerIndex);
-		}
-
-
-        #endregion
-	}
-}

+ 0 - 323
CatapaultWars/ScreenManager/MenuScreen.cs

@@ -1,323 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// MenuScreen.cs
-//
-// XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input.Touch;
-using Microsoft.Xna.Framework.Input;
-#endregion
-
-namespace GameStateManagement
-{
-    /// <summary>
-    /// Base class for screens that contain a menu of options. The user can
-    /// move up and down to select an entry, or cancel to back out of the screen.
-    /// </summary>
-    abstract class MenuScreen : GameScreen
-    {
-        #region Fields
-
-        // the number of pixels to pad above and below menu entries for touch input
-        const int menuEntryPadding = 35;
-
-        List<MenuEntry> menuEntries = new List<MenuEntry>();
-        int selectedEntry = 0;
-        string menuTitle;
-
-        #endregion
-
-        #region Properties
-
-
-        /// <summary>
-        /// Gets the list of menu entries, so derived classes can add
-        /// or change the menu contents.
-        /// </summary>
-        protected IList<MenuEntry> MenuEntries
-        {
-            get { return menuEntries; }
-        }
-
-
-        #endregion
-
-        #region Initialization
-
-
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        public MenuScreen(string menuTitle)
-        {
-            // menus generally only need Tap for menu selection
-            EnabledGestures = GestureType.Tap;
-
-            this.menuTitle = menuTitle;
-
-            TransitionOnTime = TimeSpan.FromSeconds(0.5);
-            TransitionOffTime = TimeSpan.FromSeconds(0.5);
-        }
-
-
-        #endregion
-
-        #region Handle Input
-
-        /// <summary>
-        /// Allows the screen to create the hit bounds for a particular menu entry.
-        /// </summary>
-        protected virtual Rectangle GetMenuEntryHitBounds(MenuEntry entry)
-        {
-            // the hit bounds are the entire width of the screen, and the height of the entry
-            // with some additional padding above and below.
-            return new Rectangle(
-                0,
-                (int)entry.Position.Y - menuEntryPadding,
-                ScreenManager.GraphicsDevice.Viewport.Width,
-                entry.GetHeight(this) + (menuEntryPadding * 2));
-        }
-
-        /// <summary>
-        /// Responds to user input, changing the selected entry and accepting
-        /// or cancelling the menu.
-        /// </summary>
-        public override void HandleInput(InputState input)
-        {
-            // we cancel the current menu screen if the user presses the back button
-            PlayerIndex player;
-            if (input.IsNewButtonPress(Buttons.Back, ControllingPlayer, out player))
-            {
-                OnCancel(player);
-            }
-
-			if (input.IsMenuDown(ControllingPlayer)) {
-				if (selectedEntry < menuEntries.Count - 1)
-					selectedEntry += 1;
-			}
-
-			if (input.IsMenuUp(ControllingPlayer)) {
-				if (selectedEntry > 0)
-					selectedEntry -= 1;
-			}
-
-			if (input.IsMenuSelect(ControllingPlayer, out player)) {
-				menuEntries[selectedEntry].OnSelectEntry(player);
-			}
-
-			if (input.MouseGesture.HasFlag(MouseGestureType.LeftClick)) {
-
-				Point clickLocation = new Point((int)input.CurrentMousePosition.X, (int)input.CurrentMousePosition.Y);
-				// iterate the entries to see if any were tapped
-				for (int i = 0; i < menuEntries.Count; i++)
-				{
-					MenuEntry menuEntry = menuEntries[i];
-
-					if (GetMenuEntryHitBounds(menuEntry).Contains(clickLocation))
-					{
-						// select the entry. since gestures are only available on Windows Phone,
-						// we can safely pass PlayerIndex.One to all entries since there is only
-						// one player on Windows Phone.
-						OnSelectEntry(i, PlayerIndex.One);
-					}
-				}
-			}
-
-			if (input.MouseGesture.HasFlag(MouseGestureType.Move)) {
-
-				Point clickLocation = new Point((int)input.CurrentMousePosition.X, (int)input.CurrentMousePosition.Y);
-				// iterate the entries to see if any were tapped
-				for (int i = 0; i < menuEntries.Count; i++)
-				{
-					MenuEntry menuEntry = menuEntries[i];
-
-					if (GetMenuEntryHitBounds(menuEntry).Contains(clickLocation))
-					{
-						// select the entry. since gestures are only available on Windows Phone,
-						// we can safely pass PlayerIndex.One to all entries since there is only
-						// one player on Windows Phone.
-						//OnSelectEntry(i, PlayerIndex.One);
-						selectedEntry = i;
-					}
-				}
-			}
-
-            // look for any taps that occurred and select any entries that were tapped
-            foreach (GestureSample gesture in input.Gestures)
-            {
-                if (gesture.GestureType == GestureType.Tap)
-                {
-                    // convert the position to a Point that we can test against a Rectangle
-                    Point tapLocation = new Point((int)gesture.Position.X, (int)gesture.Position.Y);
-
-                    // iterate the entries to see if any were tapped
-                    for (int i = 0; i < menuEntries.Count; i++)
-                    {
-                        MenuEntry menuEntry = menuEntries[i];
-
-                        if (GetMenuEntryHitBounds(menuEntry).Contains(tapLocation))
-                        {
-                            // select the entry. since gestures are only available on Windows Phone,
-                            // we can safely pass PlayerIndex.One to all entries since there is only
-                            // one player on Windows Phone.
-                            OnSelectEntry(i, PlayerIndex.One);
-                        }
-                    }
-                }
-            }
-        }
-
-
-        /// <summary>
-        /// Handler for when the user has chosen a menu entry.
-        /// </summary>
-        protected virtual void OnSelectEntry(int entryIndex, PlayerIndex playerIndex)
-        {
-            menuEntries[entryIndex].OnSelectEntry(playerIndex);
-        }
-
-
-        /// <summary>
-        /// Handler for when the user has cancelled the menu.
-        /// </summary>
-        protected virtual void OnCancel(PlayerIndex playerIndex)
-        {
-            ExitScreen();
-        }
-
-
-        /// <summary>
-        /// Helper overload makes it easy to use OnCancel as a MenuEntry event handler.
-        /// </summary>
-        protected void OnCancel(object sender, PlayerIndexEventArgs e)
-        {
-            OnCancel(e.PlayerIndex);
-        }
-
-
-        #endregion
-
-        #region Update and Draw
-
-
-        /// <summary>
-        /// Allows the screen the chance to position the menu entries. By default
-        /// all menu entries are lined up in a vertical list, centered on the screen.
-        /// </summary>
-        protected virtual void UpdateMenuEntryLocations()
-        {
-            // Make the menu slide into place during transitions, using a
-            // power curve to make things look more interesting (this makes
-            // the movement slow down as it nears the end).
-            float transitionOffset = (float)Math.Pow(TransitionPosition, 2);
-
-            // start at Y = 175; each X value is generated per entry
-            Vector2 position = new Vector2(0f, 175f);
-
-            // update each menu entry's location in turn
-            for (int i = 0; i < menuEntries.Count; i++)
-            {
-                MenuEntry menuEntry = menuEntries[i];
-                
-                // each entry is to be centered horizontally
-                position.X = ScreenManager.GraphicsDevice.Viewport.Width / 2 - menuEntry.GetWidth(this) / 2;
-
-                if (ScreenState == ScreenState.TransitionOn)
-                    position.X -= transitionOffset * 256;
-                else
-                    position.X += transitionOffset * 512;
-
-                // set the entry's position
-                menuEntry.Position = position;
-
-                // move down for the next entry the size of this entry plus our padding
-                position.Y += menuEntry.GetHeight(this) + (menuEntryPadding * 2);
-            }
-        }
-
-        /// <summary>
-        /// Updates the menu.
-        /// </summary>
-        public override void Update(GameTime gameTime, bool otherScreenHasFocus,
-                                                       bool coveredByOtherScreen)
-        {
-            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
-
-            // Update each nested MenuEntry object.
-            for (int i = 0; i < menuEntries.Count; i++)
-            {
-                bool isSelected = IsActive && (i == selectedEntry);
-//				if (!menuEntries[i].HasMouseEnteredAttached)
-//					menuEntries [i].MouseEntered += MouseEntered;
-//				if (!menuEntries[i].HasMouseClickedAttached)
-//					menuEntries [i].MouseClicked += MouseClicked;
-                menuEntries[i].Update(this, isSelected, gameTime);
-            }
-        }
-
-//		void MouseClicked (object sender, MenuEntryEventArgs e)
-//		{
-//			e.MenuEntry.OnSelectEntry(PlayerIndex.One);
-//		}
-//
-//		void MouseEntered (object sender, MenuEntryEventArgs e)
-//		{
-//			//Console.WriteLine("Mouse Entered menu item " + e.MenuEntry.Text);
-//			selectedEntry = menuEntries.IndexOf(e.MenuEntry);
-//		}
-
-        /// <summary>
-        /// Draws the menu.
-        /// </summary>
-        public override void Draw(GameTime gameTime)
-        {
-            // make sure our entries are in the right place before we draw them
-            UpdateMenuEntryLocations();
-
-            GraphicsDevice graphics = ScreenManager.GraphicsDevice;
-            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
-            SpriteFont font = ScreenManager.Font;
-
-            spriteBatch.Begin();
-
-            // Draw each menu entry in turn.
-            for (int i = 0; i < menuEntries.Count; i++)
-            {
-                MenuEntry menuEntry = menuEntries[i];
-
-                bool isSelected = IsActive && (i == selectedEntry);
-
-                menuEntry.Draw(this, isSelected, gameTime);
-            }
-
-            // Make the menu slide into place during transitions, using a
-            // power curve to make things look more interesting (this makes
-            // the movement slow down as it nears the end).
-            float transitionOffset = (float)Math.Pow(TransitionPosition, 2);
-
-            // Draw the menu title centered on the screen
-            Vector2 titlePosition = new Vector2(graphics.Viewport.Width / 2, 80);
-            Vector2 titleOrigin = font.MeasureString(menuTitle) / 2;
-            Color titleColor = new Color(192, 192, 192) * TransitionAlpha;
-            float titleScale = 1.25f;
-
-            titlePosition.Y -= transitionOffset * 100;
-
-            spriteBatch.DrawString(font, menuTitle, titlePosition, titleColor, 0,
-                                   titleOrigin, titleScale, SpriteEffects.None, 0);
-
-            spriteBatch.End();
-        }
-
-
-        #endregion
-    }
-}

+ 0 - 53
CatapaultWars/ScreenManager/MouseGestureType.cs

@@ -1,53 +0,0 @@
-#region License
-// /*
-// Microsoft Public License (Ms-PL)
-// MonoGame - Copyright © 2009-2010 The MonoGame Team
-// 
-// All rights reserved.
-// 
-// This license governs use of the accompanying software. If you use the software, you accept this license. If you do not
-// accept the license, do not use the software.
-// 
-// 1. Definitions
-// The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under 
-// U.S. copyright law.
-// 
-// A "contribution" is the original software, or any additions or changes to the software.
-// A "contributor" is any person that distributes its contribution under this license.
-// "Licensed patents" are a contributor's patent claims that read directly on its contribution.
-// 
-// 2. Grant of Rights
-// (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, 
-// each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
-// (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, 
-// each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
-// 
-// 3. Conditions and Limitations
-// (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
-// (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, 
-// your patent license from such contributor to the software ends automatically.
-// (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution 
-// notices that are present in the software.
-// (D) If you distribute any portion of the software in source code form, you may do so only under this license by including 
-// a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object 
-// code form, you may only do so under a license that complies with this license.
-// (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees
-// or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent
-// permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular
-// purpose and non-infringement.
-// */
-#endregion License
-using System;
-
-namespace GameStateManagement
-{
-	[Flags]
-	public enum MouseGestureType
-	{
-		None = 0,
-		LeftClick = 1,
-		DragComplete = 2,		        
-		FreeDrag = 4,
-		Move = 8,
-	}
-}

+ 0 - 42
CatapaultWars/ScreenManager/PlayerIndexEventArgs.cs

@@ -1,42 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// PlayerIndexEventArgs.cs
-//
-// XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using Microsoft.Xna.Framework;
-#endregion
-
-namespace GameStateManagement
-{
-    /// <summary>
-    /// Custom event argument which includes the index of the player who
-    /// triggered the event. This is used by the MenuEntry.Selected event.
-    /// </summary>
-    class PlayerIndexEventArgs : EventArgs
-    {
-        /// <summary>
-        /// Constructor.
-        /// </summary>
-        public PlayerIndexEventArgs(PlayerIndex playerIndex)
-        {
-            this.playerIndex = playerIndex;
-        }
-
-
-        /// <summary>
-        /// Gets the index of the player who triggered this event.
-        /// </summary>
-        public PlayerIndex PlayerIndex
-        {
-            get { return playerIndex; }
-        }
-
-        PlayerIndex playerIndex;
-    }
-}

+ 0 - 450
CatapaultWars/ScreenManager/ScreenManager.cs

@@ -1,450 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// ScreenManager.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Diagnostics;
-using System.Collections.Generic;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input.Touch;
-using System.IO;
-using System.IO.IsolatedStorage;
-#endregion
-
-namespace GameStateManagement
-{
-    /// <summary>
-    /// The screen manager is a component which manages one or more GameScreen
-    /// instances. It maintains a stack of screens, calls their Update and Draw
-    /// methods at the appropriate times, and automatically routes input to the
-    /// topmost active screen.
-    /// </summary>
-    public class ScreenManager : DrawableGameComponent
-    {
-        #region Fields
-
-        List<GameScreen> screens = new List<GameScreen>();
-        List<GameScreen> screensToUpdate = new List<GameScreen>();
-
-        InputState input = new InputState();
-
-        SpriteBatch spriteBatch;
-        SpriteFont font;
-        Texture2D blankTexture;
-
-        bool isInitialized;
-
-        bool traceEnabled;
-
-        #endregion
-
-        #region Properties
-
-
-        /// <summary>
-        /// A default SpriteBatch shared by all the screens. This saves
-        /// each screen having to bother creating their own local instance.
-        /// </summary>
-        public SpriteBatch SpriteBatch
-        {
-            get { return spriteBatch; }
-        }
-
-
-        /// <summary>
-        /// A default font shared by all the screens. This saves
-        /// each screen having to bother loading their own local copy.
-        /// </summary>
-        public SpriteFont Font
-        {
-            get { return font; }
-        }
-
-
-        /// <summary>
-        /// If true, the manager prints out a list of all the screens
-        /// each time it is updated. This can be useful for making sure
-        /// everything is being added and removed at the right times.
-        /// </summary>
-        public bool TraceEnabled
-        {
-            get { return traceEnabled; }
-            set { traceEnabled = value; }
-        }
-
-
-        #endregion
-
-        #region Initialization
-
-
-        /// <summary>
-        /// Constructs a new screen manager component.
-        /// </summary>
-        public ScreenManager(Game game)
-            : base(game)
-        {
-            // we must set EnabledGestures before we can query for them, but
-            // we don't assume the game wants to read them.
-            TouchPanel.EnabledGestures = GestureType.None;
-        }
-
-
-        /// <summary>
-        /// Initializes the screen manager component.
-        /// </summary>
-        public override void Initialize()
-        {
-            base.Initialize();
-
-            isInitialized = true;
-        }
-
-
-        /// <summary>
-        /// Load your graphics content.
-        /// </summary>
-        protected override void LoadContent()
-        {
-            // Load content belonging to the screen manager.
-            ContentManager content = Game.Content;
-
-            spriteBatch = new SpriteBatch(GraphicsDevice);
-            font = content.Load<SpriteFont>("Fonts/MenuFont");
-            blankTexture = content.Load<Texture2D>("Textures/Backgrounds/blank");
-
-            // Tell each of the screens to load their content.
-            foreach (GameScreen screen in screens)
-            {
-                screen.LoadContent();
-            }
-        }
-
-
-        /// <summary>
-        /// Unload your graphics content.
-        /// </summary>
-        protected override void UnloadContent()
-        {
-            // Tell each of the screens to unload their content.
-            foreach (GameScreen screen in screens)
-            {
-                screen.UnloadContent();
-            }
-        }
-
-
-        #endregion
-
-        #region Update and Draw
-
-
-        /// <summary>
-        /// Allows each screen to run logic.
-        /// </summary>
-        public override void Update(GameTime gameTime)
-        {
-            // Read the keyboard and gamepad.
-            input.Update();
-
-            // Make a copy of the master screen list, to avoid confusion if
-            // the process of updating one screen adds or removes others.
-            screensToUpdate.Clear();
-
-            foreach (GameScreen screen in screens)
-                screensToUpdate.Add(screen);
-
-            bool otherScreenHasFocus = !Game.IsActive;
-            bool coveredByOtherScreen = false;
-
-            // Loop as long as there are screens waiting to be updated.
-            while (screensToUpdate.Count > 0)
-            {
-                // Pop the topmost screen off the waiting list.
-                GameScreen screen = screensToUpdate[screensToUpdate.Count - 1];
-
-                screensToUpdate.RemoveAt(screensToUpdate.Count - 1);
-
-                // Update the screen.
-                screen.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
-
-                if (screen.ScreenState == ScreenState.TransitionOn ||
-                    screen.ScreenState == ScreenState.Active)
-                {
-                    // If this is the first active screen we came across,
-                    // give it a chance to handle input.
-                    if (!otherScreenHasFocus)
-                    {
-                        screen.HandleInput(input);
-
-                        otherScreenHasFocus = true;
-                    }
-
-                    // If this is an active non-popup, inform any subsequent
-                    // screens that they are covered by it.
-                    if (!screen.IsPopup)
-                        coveredByOtherScreen = true;
-                }
-            }
-
-            // Print debug trace?
-            if (traceEnabled)
-                TraceScreens();
-        }
-
-
-        /// <summary>
-        /// Prints a list of all the screens, for debugging.
-        /// </summary>
-        void TraceScreens()
-        {
-            List<string> screenNames = new List<string>();
-
-            foreach (GameScreen screen in screens)
-                screenNames.Add(screen.GetType().Name);
-
-            Debug.WriteLine(string.Join(", ", screenNames.ToArray()));
-        }
-
-
-        /// <summary>
-        /// Tells each screen to draw itself.
-        /// </summary>
-        public override void Draw(GameTime gameTime)
-        {
-            foreach (GameScreen screen in screens)
-            {
-                if (screen.ScreenState == ScreenState.Hidden)
-                    continue;
-
-                screen.Draw(gameTime);
-            }
-        }
-
-
-        #endregion
-
-        #region Public Methods
-
-
-        /// <summary>
-        /// Adds a new screen to the screen manager.
-        /// </summary>
-        public void AddScreen(GameScreen screen, PlayerIndex? controllingPlayer)
-        {
-            screen.ControllingPlayer = controllingPlayer;
-            screen.ScreenManager = this;
-            screen.IsExiting = false;
-
-            // If we have a graphics device, tell the screen to load content.
-            if (isInitialized)
-            {
-                screen.LoadContent();
-            }
-
-            screens.Add(screen);
-
-            // update the TouchPanel to respond to gestures this screen is interested in
-            TouchPanel.EnabledGestures = screen.EnabledGestures;
-        }
-
-
-        /// <summary>
-        /// Removes a screen from the screen manager. You should normally
-        /// use GameScreen.ExitScreen instead of calling this directly, so
-        /// the screen can gradually transition off rather than just being
-        /// instantly removed.
-        /// </summary>
-        public void RemoveScreen(GameScreen screen)
-        {
-            // If we have a graphics device, tell the screen to unload content.
-            if (isInitialized)
-            {
-                screen.UnloadContent();
-            }
-
-            screens.Remove(screen);
-            screensToUpdate.Remove(screen);
-
-            // if there is a screen still in the manager, update TouchPanel
-            // to respond to gestures that screen is interested in.
-            if (screens.Count > 0)
-            {
-                TouchPanel.EnabledGestures = screens[screens.Count - 1].EnabledGestures;
-            }
-        }
-
-
-        /// <summary>
-        /// Expose an array holding all the screens. We return a copy rather
-        /// than the real master list, because screens should only ever be added
-        /// or removed using the AddScreen and RemoveScreen methods.
-        /// </summary>
-        public GameScreen[] GetScreens()
-        {
-            return screens.ToArray();
-        }
-
-
-        /// <summary>
-        /// Helper draws a translucent black fullscreen sprite, used for fading
-        /// screens in and out, and for darkening the background behind popups.
-        /// </summary>
-        public void FadeBackBufferToBlack(float alpha)
-        {
-            Viewport viewport = GraphicsDevice.Viewport;
-
-            spriteBatch.Begin();
-
-            spriteBatch.Draw(blankTexture,
-                             new Rectangle(0, 0, viewport.Width, viewport.Height),
-                             Color.Black * alpha);
-
-            spriteBatch.End();
-        }
-
-        /// <summary>
-        /// Informs the screen manager to serialize its state to disk.
-        /// </summary>
-        public void SerializeState()
-        {
-            // open up isolated storage
-            using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
-            {
-                // if our screen manager directory already exists, delete the contents
-                if (storage.DirectoryExists("ScreenManager"))
-                {
-                    DeleteState(storage);
-                }
-
-                // otherwise just create the directory
-                else
-                {
-                    storage.CreateDirectory("ScreenManager");
-                }
-
-                // create a file we'll use to store the list of screens in the stack
-                using (IsolatedStorageFileStream stream = storage.CreateFile("ScreenManager\\ScreenList.dat"))
-                {
-                    using (BinaryWriter writer = new BinaryWriter(stream))
-                    {
-                        // write out the full name of all the types in our stack so we can
-                        // recreate them if needed.
-                        foreach (GameScreen screen in screens)
-                        {
-                            if (screen.IsSerializable)
-                            {
-                                writer.Write(screen.GetType().AssemblyQualifiedName);
-                            }
-                        }
-                    }
-                }
-
-                // now we create a new file stream for each screen so it can save its state
-                // if it needs to. we name each file "ScreenX.dat" where X is the index of
-                // the screen in the stack, to ensure the files are uniquely named
-                int screenIndex = 0;
-                foreach (GameScreen screen in screens)
-                {
-                    if (screen.IsSerializable)
-                    {
-                        string fileName = string.Format("ScreenManager\\Screen{0}.dat", screenIndex);
-
-                        // open up the stream and let the screen serialize whatever state it wants
-                        using (IsolatedStorageFileStream stream = storage.CreateFile(fileName))
-                        {
-                            screen.Serialize(stream);
-                        }
-
-                        screenIndex++;
-                    }
-                }
-            }
-        }
-
-        public bool DeserializeState()
-        {
-            // open up isolated storage
-            using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
-            {
-                // see if our saved state directory exists
-                if (storage.DirectoryExists("ScreenManager"))
-                {
-                    try
-                    {
-                        // see if we have a screen list
-                        if (storage.FileExists("ScreenManager\\ScreenList.dat"))
-                        {
-                            // load the list of screen types
-                            using (IsolatedStorageFileStream stream = 
-                                storage.OpenFile("ScreenManager\\ScreenList.dat", FileMode.Open, FileAccess.Read))
-                            {
-                                using (BinaryReader reader = new BinaryReader(stream))
-                                {
-                                    while (reader.BaseStream.Position < reader.BaseStream.Length)
-                                    {
-                                        // read a line from our file
-                                        string line = reader.ReadString();
-
-                                        // if it isn't blank, we can create a screen from it
-                                        if (!string.IsNullOrEmpty(line))
-                                        {
-                                            Type screenType = Type.GetType(line);
-                                            GameScreen screen = Activator.CreateInstance(screenType) as GameScreen;
-                                            AddScreen(screen, PlayerIndex.One);
-                                        }
-                                    }
-                                }
-                            }
-                        }
-
-                        // next we give each screen a chance to deserialize from the disk
-                        for (int i = 0; i < screens.Count; i++)
-                        {
-                            string filename = string.Format("ScreenManager\\Screen{0}.dat", i);
-                            using (IsolatedStorageFileStream stream = 
-                                storage.OpenFile(filename, FileMode.Open, FileAccess.Read))
-                            {
-                                screens[i].Deserialize(stream);
-                            }
-                        }
-
-                        return true;
-                    }
-                    catch (Exception)
-                    {
-                        // if an exception was thrown while reading, odds are we cannot recover
-                        // from the saved state, so we will delete it so the game can correctly
-                        // launch.
-                        DeleteState(storage);
-                    }
-                }
-            }
-
-            return false;
-        }
-
-        /// <summary>
-        /// Deletes the saved state files from isolated storage.
-        /// </summary>
-        private void DeleteState(IsolatedStorageFile storage)
-        {
-            // get all of the files in the directory and delete them
-            string[] files = storage.GetFileNames("ScreenManager\\*");
-            foreach (string file in files)
-            {
-                storage.DeleteFile(Path.Combine("ScreenManager", file));
-            }
-        }
-
-        #endregion
-    }
-}

+ 0 - 58
CatapaultWars/Screens/BackgroundScreen.cs

@@ -1,58 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// BackgroundScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework;
-using GameStateManagement;
-#endregion
-
-namespace CatapultGame
-{
-    class BackgroundScreen : GameScreen
-    {
-        #region Fields
-        Texture2D background;
-        #endregion
-
-        #region Initialization
-        public BackgroundScreen()
-        {
-            TransitionOnTime = TimeSpan.FromSeconds(0.0);
-            TransitionOffTime = TimeSpan.FromSeconds(0.5);
-        }
-        #endregion
-
-        #region Loading
-        public override void LoadContent()
-        {
-            background = Load<Texture2D>("Textures/Backgrounds/title_screen");           
-        }
-        #endregion
-
-        #region Render        
-        public override void Draw(GameTime gameTime)
-        {
-            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
-
-            spriteBatch.Begin();
-
-            // Draw Background
-            spriteBatch.Draw(background, new Vector2(0, 0),
-                 new Color(255, 255, 255, TransitionAlpha));
-
-            spriteBatch.End();
-        }
-        #endregion
-    }
-}

+ 0 - 507
CatapaultWars/Screens/GameplayScreen.cs

@@ -1,507 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// GameplayScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Audio;
-using System.IO.IsolatedStorage;
-using System.IO;
-using Microsoft.Xna.Framework.Input;
-using Microsoft.Xna.Framework.Input.Touch;
-//using Microsoft.Devices.Sensors;
-using GameStateManagement;
-#endregion
-
-namespace CatapultGame
-{
-    class GameplayScreen : GameScreen
-    {
-        #region Fields
-        // Texture Members
-        Texture2D foregroundTexture;
-        Texture2D cloud1Texture;
-        Texture2D cloud2Texture;
-        Texture2D mountainTexture;
-        Texture2D skyTexture;
-        Texture2D hudBackgroundTexture;
-        Texture2D ammoTypeTexture;
-        Texture2D windArrowTexture;
-        Texture2D defeatTexture;
-        Texture2D victoryTexture;
-        SpriteFont hudFont;
-
-        // Rendering members
-        Vector2 cloud1Position;
-        Vector2 cloud2Position;
-
-        Vector2 playerHUDPosition;
-        Vector2 computerHUDPosition;
-        Vector2 windArrowPosition;
-
-        // Gameplay members
-        Human player;
-        AI computer;
-        Vector2 wind;
-        bool changeTurn;
-        bool isHumanTurn;
-        bool gameOver;
-        Random random;
-        const int minWind = 0;
-        const int maxWind = 10;
-
-        // Helper members
-        bool isDragging;
-        #endregion
-
-        #region Initialization
-        public GameplayScreen()
-        {
-            EnabledGestures = GestureType.FreeDrag |
-                GestureType.DragComplete |
-                GestureType.Tap;
-
-            random = new Random();
-        }
-        #endregion
-
-        #region Content Loading/Unloading
-        /// <summary>
-        /// Loads the game assets and initializes "players"
-        /// </summary>
-        public override void LoadContent()
-        {
-            base.LoadContent();
-#if ANDROID || IPHONE			
-			LoadAssets();
-#endif			
-            // Start the game
-            Start();
-        }
-
-        public void LoadAssets()
-        {
-            // Load textures
-            foregroundTexture = Load<Texture2D>("Textures/Backgrounds/gameplay_screen");
-            cloud1Texture = Load<Texture2D>("Textures/Backgrounds/cloud1");
-            cloud2Texture = Load<Texture2D>("Textures/Backgrounds/cloud2");
-            mountainTexture = Load<Texture2D>("Textures/Backgrounds/mountain");
-            skyTexture = Load<Texture2D>("Textures/Backgrounds/sky");
-            defeatTexture = Load<Texture2D>("Textures/Backgrounds/defeat");
-            victoryTexture = Load<Texture2D>("Textures/Backgrounds/victory");
-            hudBackgroundTexture = Load<Texture2D>("Textures/HUD/hudBackground");
-            windArrowTexture = Load<Texture2D>("Textures/HUD/windArrow");
-            ammoTypeTexture = Load<Texture2D>("Textures/HUD/ammoType");
-			
-			
-			
-            // Load font
-            hudFont = Load<SpriteFont>("Fonts/HUDFont");
-
-            // Define initial cloud position
-            cloud1Position = new Vector2(224 - cloud1Texture.Width, 32);
-            cloud2Position = new Vector2(64, 90);
-
-            // Define initial HUD positions
-            playerHUDPosition = new Vector2(7, 7);
-            computerHUDPosition = new Vector2(613, 7);
-            windArrowPosition = new Vector2(345, 46);
-
-            // Initialize human & AI players
-            player = new Human(ScreenManager.Game, ScreenManager.SpriteBatch);
-            player.Initialize();
-            player.Name = "Player";
-
-            computer = new AI(ScreenManager.Game, ScreenManager.SpriteBatch);
-            computer.Initialize();
-            computer.Name = "Phone";
-
-            // Identify enemies
-            player.Enemy = computer;
-            computer.Enemy = player;
-        }
-        #endregion
-
-        #region Update
-        /// <summary>
-        /// Runs one frame of update for the game.
-        /// </summary>
-        /// <param name="gameTime">Provides a snapshot of timing values.</param>
-        public override void Update(GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
-        {
-            float elapsed = (float)gameTime.ElapsedGameTime.TotalSeconds;
-
-            // Check it one of the players reached 5 and stop the game
-            if ((player.Catapult.GameOver || computer.Catapult.GameOver) &&
-                (gameOver == false))
-            {
-                gameOver = true;
-
-                if (player.Score > computer.Score)
-                {
-                    AudioManager.PlaySound("gameOver_Win");
-                }
-                else
-                {
-                    AudioManager.PlaySound("gameOver_Lose");
-                }
-
-                return;
-            }
-
-            // If Reset flag raised and both catapults are not animating - 
-            // active catapult finished the cycle, new turn!
-            if ((player.Catapult.CurrentState == CatapultState.Reset ||
-                computer.Catapult.CurrentState == CatapultState.Reset) &&
-                !(player.Catapult.AnimationRunning ||
-                computer.Catapult.AnimationRunning))
-            {
-                changeTurn = true;
-
-                if (player.IsActive == true) //Last turn was a human turn?
-                {
-                    player.IsActive = false;
-                    computer.IsActive = true;
-                    isHumanTurn = false;
-                    player.Catapult.CurrentState = CatapultState.Idle;
-                    computer.Catapult.CurrentState = CatapultState.Aiming;
-                }
-                else //It was an AI turn
-                {
-                    player.IsActive = true;
-                    computer.IsActive = false;
-                    isHumanTurn = true;
-                    computer.Catapult.CurrentState = CatapultState.Idle;
-                    player.Catapult.CurrentState = CatapultState.Idle;
-                }
-            }
-
-            if (changeTurn)
-            {
-                // Update wind
-                wind = new Vector2(random.Next(-1, 2),
-                    random.Next(minWind, maxWind + 1));
-
-                // Set new wind value to the players and 
-                player.Catapult.Wind = computer.Catapult.Wind =
-                    wind.X > 0 ? wind.Y : -wind.Y;
-                changeTurn = false;
-            }
-
-            // Update the players
-            player.Update(gameTime);
-            computer.Update(gameTime);
-
-            // Updates the clouds position
-            UpdateClouds(elapsed);
-
-            base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen);
-        }
-        #endregion
-
-        #region Draw
-        /// <summary>
-        /// Draw the game world, effects, and HUD
-        /// </summary>
-        /// <param name="gameTime">The elapsed time since last Draw</param>
-        public override void Draw(GameTime gameTime)
-        {
-            ScreenManager.SpriteBatch.Begin();
-
-            // Render all parts of the screen
-            DrawBackground();
-            DrawComputer(gameTime);
-            DrawPlayer(gameTime);
-            DrawHud();
-
-            ScreenManager.SpriteBatch.End();
-        }
-        #endregion
-
-        #region Input
-        /// <summary>
-        /// Input helper method provided by GameScreen.  Packages up the various input
-        /// values for ease of use.
-        /// </summary>
-        /// <param name="input">The state of the gamepads</param>
-        public override void HandleInput(InputState input)
-        {
-            if (input == null)
-                throw new ArgumentNullException("input");
-
-            if (gameOver)
-            {
-                if (input.IsPauseGame(null))
-                {
-                    FinishCurrentGame();
-                }
-
-                foreach (GestureSample gestureSample in input.Gestures)
-                {
-                    if (gestureSample.GestureType == GestureType.Tap)
-                    {
-                        FinishCurrentGame();
-                    }
-                }
-
-                return;
-            }
-
-            if (input.IsPauseGame(null))
-            {
-                PauseCurrentGame();
-            }
-            else if (isHumanTurn &&
-                (player.Catapult.CurrentState == CatapultState.Idle ||
-                    player.Catapult.CurrentState == CatapultState.Aiming))
-            {
-				// First we try with mouse input
-				player.HandleInput(input);
-				if (input.MouseGesture == MouseGestureType.FreeDrag)
-					isDragging = true;
-				else if (input.MouseGesture == MouseGestureType.DragComplete)
-					isDragging = false;
-
-                // Read all available gestures
-                foreach (GestureSample gestureSample in input.Gestures)
-                {
-                    if (gestureSample.GestureType == GestureType.FreeDrag)
-                        isDragging = true;
-                    else if (gestureSample.GestureType == GestureType.DragComplete)
-                        isDragging = false;
-
-                    player.HandleInput(gestureSample);
-                }
-            }
-        }
-        #endregion
-
-        #region Update Helpers
-        private void UpdateClouds(float elapsedTime)
-        {
-            // Move the clouds according to the wind
-            int windDirection = wind.X > 0 ? 1 : -1;
-
-            cloud1Position += new Vector2(24.0f, 0.0f) * elapsedTime *
-                windDirection * wind.Y;
-            if (cloud1Position.X > ScreenManager.GraphicsDevice.Viewport.Width)
-                cloud1Position.X = -cloud1Texture.Width * 2.0f;
-            else if (cloud1Position.X < -cloud1Texture.Width * 2.0f)
-                cloud1Position.X = ScreenManager.GraphicsDevice.Viewport.Width;
-
-            cloud2Position += new Vector2(16.0f, 0.0f) * elapsedTime *
-                windDirection * wind.Y;
-            if (cloud2Position.X > ScreenManager.GraphicsDevice.Viewport.Width)
-                cloud2Position.X = -cloud2Texture.Width * 2.0f;
-            else if (cloud2Position.X < -cloud2Texture.Width * 2.0f)
-                cloud2Position.X = ScreenManager.GraphicsDevice.Viewport.Width;
-        }
-        #endregion
-
-        #region Draw Helpers
-        /// <summary>
-        /// Draws the player's catapult
-        /// </summary>
-        void DrawPlayer(GameTime gameTime)
-        {
-            if (!gameOver)
-                player.Draw(gameTime);
-        }
-
-        /// <summary>
-        /// Draws the AI's catapult
-        /// </summary>
-        void DrawComputer(GameTime gameTime)
-        {
-            if (!gameOver)
-                computer.Draw(gameTime);
-        }
-
-        /// <summary>
-        /// Draw the sky, clouds, mountains, etc. 
-        /// </summary>
-        private void DrawBackground()
-        {
-            // Clear the background
-            ScreenManager.Game.GraphicsDevice.Clear(Color.White);
-
-            // Draw the Sky
-            ScreenManager.SpriteBatch.Draw(skyTexture, Vector2.Zero, Color.White);
-
-            // Draw Cloud #1
-            ScreenManager.SpriteBatch.Draw(cloud1Texture,
-                cloud1Position, Color.White);
-
-            // Draw the Mountain
-            ScreenManager.SpriteBatch.Draw(mountainTexture,
-                Vector2.Zero, Color.White);
-
-            // Draw Cloud #2
-            ScreenManager.SpriteBatch.Draw(cloud2Texture,
-                cloud2Position, Color.White);
-
-            // Draw the Castle, trees, and foreground 
-            ScreenManager.SpriteBatch.Draw(foregroundTexture,
-                Vector2.Zero, Color.White);
-        }
-
-        /// <summary>
-        /// Draw the HUD, which consists of the score elements and the GAME OVER tag.
-        /// </summary>
-        void DrawHud()
-        {
-            if (gameOver)
-            {
-                Texture2D texture;
-                if (player.Score > computer.Score)
-                {
-                    texture = victoryTexture;
-                }
-                else
-                {
-                    texture = defeatTexture;
-                }
-
-                ScreenManager.SpriteBatch.Draw(
-                    texture,
-                    new Vector2(ScreenManager.Game.GraphicsDevice.Viewport.Width / 2 - texture.Width / 2,
-                                ScreenManager.Game.GraphicsDevice.Viewport.Height / 2 - texture.Height / 2),
-                    Color.White);
-            }
-            else
-            {
-                // Draw Player Hud
-                ScreenManager.SpriteBatch.Draw(hudBackgroundTexture,
-                    playerHUDPosition, Color.White);
-                ScreenManager.SpriteBatch.Draw(ammoTypeTexture,
-                    playerHUDPosition + new Vector2(33, 35), Color.White);
-                DrawString(hudFont, player.Score.ToString(),
-                    playerHUDPosition + new Vector2(123, 35), Color.White);
-                DrawString(hudFont, player.Name,
-                    playerHUDPosition + new Vector2(40, 1), Color.Blue);
-
-                // Draw Computer Hud
-                ScreenManager.SpriteBatch.Draw(hudBackgroundTexture,
-                    computerHUDPosition, Color.White);
-                ScreenManager.SpriteBatch.Draw(ammoTypeTexture,
-                    computerHUDPosition + new Vector2(33, 35), Color.White);
-                DrawString(hudFont, computer.Score.ToString(),
-                    computerHUDPosition + new Vector2(123, 35), Color.White);
-                DrawString(hudFont, computer.Name,
-                    computerHUDPosition + new Vector2(40, 1), Color.Red);
-
-                // Draw Wind direction
-                string text = "WIND";
-                Vector2 size = hudFont.MeasureString(text);
-                Vector2 windarrowScale = new Vector2(wind.Y / 10, 1);
-                ScreenManager.SpriteBatch.Draw(windArrowTexture,
-                    windArrowPosition, null, Color.White, 0, Vector2.Zero,
-                    windarrowScale, wind.X > 0
-                    ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0);
-
-                DrawString(hudFont, text,
-                    windArrowPosition - new Vector2(0, size.Y), Color.Black);
-                if (wind.Y == 0)
-                {
-                    text = "NONE";
-                    DrawString(hudFont, text, windArrowPosition, Color.Black);
-                }
-
-                if (isHumanTurn)
-                {
-                    // Prepare human prompt message
-                    text = !isDragging ?
-                        "Drag Anywhere to Fire" : "Release to Fire!";
-                    size = hudFont.MeasureString(text);
-                }
-                else
-                {
-                    // Prepare AI message
-                    text = "I'll get you yet!";
-                    size = hudFont.MeasureString(text);
-                }
-
-                DrawString(hudFont, text,
-                    new Vector2(
-                        ScreenManager.GraphicsDevice.Viewport.Width / 2 - size.X / 2,
-                        ScreenManager.GraphicsDevice.Viewport.Height - size.Y),
-                        Color.Green);
-            }
-        }
-
-        /// <summary>
-        /// A simple helper to draw shadowed text.
-        /// </summary>
-        void DrawString(SpriteFont font, string text, Vector2 position, Color color)
-        {
-            ScreenManager.SpriteBatch.DrawString(font, text,
-                new Vector2(position.X + 1, position.Y + 1), Color.Black);
-            ScreenManager.SpriteBatch.DrawString(font, text, position, color);
-        }
-
-        /// <summary>
-        /// A simple helper to draw shadowed text.
-        /// </summary>
-        void DrawString(SpriteFont font, string text, Vector2 position, Color color, float fontScale)
-        {
-            ScreenManager.SpriteBatch.DrawString(font, text, new Vector2(position.X + 1,
-                position.Y + 1), Color.Black, 0, new Vector2(0, font.LineSpacing / 2),
-                fontScale, SpriteEffects.None, 0);
-            ScreenManager.SpriteBatch.DrawString(font, text, position, color, 0,
-                new Vector2(0, font.LineSpacing / 2), fontScale, SpriteEffects.None, 0);
-        }
-        #endregion
-
-        #region Input Helpers
-        /// <summary>
-        /// Finish the current game
-        /// </summary>
-        private void FinishCurrentGame()
-        {
-            ExitScreen();
-        }
-
-        /// <summary>
-        /// Pause the current game
-        /// </summary>
-        private void PauseCurrentGame()
-        {
-            var pauseMenuBackground = new BackgroundScreen();
-
-            if (isDragging)
-            {
-                isDragging = false;
-                player.Catapult.CurrentState = CatapultState.Idle;
-            }
-
-            ScreenManager.AddScreen(pauseMenuBackground, null);
-            ScreenManager.AddScreen(new PauseScreen(pauseMenuBackground, 
-                player, computer), null);
-        }
-        #endregion
-
-        #region Gameplay Helpers
-        /// <summary>
-        /// Starts a new game session, setting all game states to initial values.
-        /// </summary>
-        void Start()
-        {
-            // Set initial wind direction
-            wind = Vector2.Zero;
-            isHumanTurn = false;
-            changeTurn = true;
-            computer.Catapult.CurrentState = CatapultState.Reset;
-        }
-        #endregion
-    }
-}

+ 0 - 188
CatapaultWars/Screens/InstructionsScreen.cs

@@ -1,188 +0,0 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// BackgroundScreen.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading;
-
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework;
-using GameStateManagement;
-using Microsoft.Xna.Framework.Input.Touch;
-
-#if MONOMAC
-using MonoMac.AppKit;
-using MonoMac.Foundation;
-#endif
-
-#if IPHONE
-using MonoTouch.UIKit;
-using MonoTouch.Foundation;
-#endif
-#endregion
-
-namespace CatapultGame
-{
-	class InstructionsScreen : GameScreen
-	{
-#region Fields
-		Texture2D background;
-		SpriteFont font;
-		bool isLoading;
-		GameplayScreen gameplayScreen;
-		System.Threading.Thread thread;
-#endregion
-
-#region Initialization
-		public InstructionsScreen ()
-		{
-			EnabledGestures = GestureType.Tap;
-
-			TransitionOnTime = TimeSpan.FromSeconds (0);
-			TransitionOffTime = TimeSpan.FromSeconds (0.5);
-		}
-#endregion
-
-#region Loading
-		public override void LoadContent ()
-		{
-			background = Load<Texture2D> ("Textures/Backgrounds/instructions");
-			font = Load<SpriteFont> ("Fonts/MenuFont");
-		}
-#endregion
-
-		public override void Update (GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen)
-		{
-			// If additional thread is running, skip
-			if (null != thread) {
-				// If additional thread finished loading and the screen is not exiting
-				if (thread.ThreadState == System.Threading.ThreadState.Stopped && !IsExiting) {
-					isLoading = false;
-					
-					// Exit the screen and show the gameplay screen 
-					// with pre-loaded assets
-					ExitScreen ();
-					ScreenManager.AddScreen (gameplayScreen, null);
-				}
-			}
-			base.Update (gameTime, otherScreenHasFocus, coveredByOtherScreen);
-		}
-
-#region Handle input
-		public override void HandleInput (InputState input)
-		{
-			if (isLoading == true) {
-#if ANDROID || IPHONE
-				// Exit the screen and show the gameplay screen 
-					// with pre-loaded assets
-				ExitScreen ();
-				ScreenManager.AddScreen (gameplayScreen, null);
-#endif				
-				base.HandleInput (input);
-				return;
-			}
-			PlayerIndex player;
-			if (input.IsNewKeyPress (Microsoft.Xna.Framework.Input.Keys.Space, ControllingPlayer, out player) ||
-			    input.IsNewKeyPress (Microsoft.Xna.Framework.Input.Keys.Enter, ControllingPlayer, out player) ||
-			    input.MouseGesture.HasFlag(MouseGestureType.LeftClick)||
-			    input.IsNewButtonPress (Microsoft.Xna.Framework.Input.Buttons.Start, ControllingPlayer, out player)) {
-				// Create a new instance of the gameplay screen
-				gameplayScreen = new GameplayScreen ();
-				gameplayScreen.ScreenManager = ScreenManager;
-
-				// Start loading the resources in additional thread
-#if MONOMAC
-				// create a new thread using BackgroundWorkerThread as method to execute
-				thread = new Thread (LoadAssetsWorkerThread as ThreadStart);
-#else
-				thread = new System.Threading.Thread (new System.Threading.ThreadStart (gameplayScreen.LoadAssets));
-#endif
-				isLoading = true;
-				// start it
-				thread.Start ();
-
-			}
-
-			foreach (var gesture in input.Gestures) {
-				if (gesture.GestureType == GestureType.Tap) {
-					// Create a new instance of the gameplay screen
-					gameplayScreen = new GameplayScreen ();
-					gameplayScreen.ScreenManager = ScreenManager;
-					
-#if ANDROID || IPHONE	
-					isLoading = true;									
-#else				
-					// Start loading the resources in additional thread
-					thread = new System.Threading.Thread (new System.Threading.ThreadStart (gameplayScreen.LoadAssets));
-					isLoading = true;
-					thread.Start ();	
-#endif										
-					
-				}
-			}
-
-			base.HandleInput (input);
-		}
-
-		void LoadAssetsWorkerThread ()
-		{
-
-#if MONOMAC || IPHONE			
-			// Create an Autorelease Pool or we will leak objects.
-			using (var pool = new NSAutoreleasePool()) {
-#else				
-				
-#endif				
-				// Make sure we invoke this on the Main Thread or OpenGL will throw an error
-#if MONOMAC
-				MonoMac.AppKit.NSApplication.SharedApplication.BeginInvokeOnMainThread (delegate {
-#endif
-#if IPHONE
-				var invokeOnMainThredObj = new NSObject();
-				invokeOnMainThredObj.InvokeOnMainThread(delegate {
-#endif
-					gameplayScreen.LoadAssets ();
-#if MONOMAC || IPHONE						
-				});
-					
-			}				
-#endif				
-
-		}
-#endregion
-
-#region Render
-		public override void Draw (GameTime gameTime)
-		{
-			SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
-
-			spriteBatch.Begin ();
-
-			// Draw Background
-			spriteBatch.Draw (background, new Vector2 (0, 0), new Color (255, 255, 255, TransitionAlpha));
-
-			// If loading gameplay screen resource in the 
-			// background show "Loading..." text
-			if (isLoading) {
-				string text = "Loading...";
-				Vector2 size = font.MeasureString (text);
-				Vector2 position = new Vector2 ((ScreenManager.GraphicsDevice.Viewport.Width - size.X) / 2,
-				                                (ScreenManager.GraphicsDevice.Viewport.Height - size.Y) / 2);
-				spriteBatch.DrawString (font, text, position, Color.Black);
-				spriteBatch.DrawString (font, text, position - new Vector2 (-4, 4), new Color (255f, 150f, 0f));
-			}
-
-			spriteBatch.End ();
-		}
-#endregion
-	}
-}

+ 27 - 0
CatapultNetWars/.vscode/launch.json

@@ -0,0 +1,27 @@
+{
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "name": "Launch Windows",
+            "type": "coreclr",
+            "request": "launch",
+            "preLaunchTask": "build-windows",
+            "program": "${workspaceFolder}/Platforms/Windows/bin/Debug/net8.0-windows/CatapultNetWars.exe",
+            "args": [],
+            "cwd": "${workspaceFolder}",
+            "console": "internalConsole",
+            "stopAtEntry": false
+        },
+        {
+            "name": "Launch DesktopGL",
+            "type": "coreclr",
+            "request": "launch",
+            "preLaunchTask": "build-desktopgl",
+            "program": "${workspaceFolder}/Platforms/Desktop/bin/Debug/net8.0/CatapultNetWars",
+            "args": [],
+            "cwd": "${workspaceFolder}",
+            "console": "internalConsole",
+            "stopAtEntry": false
+        }
+    ]
+}

+ 47 - 0
CatapultNetWars/.vscode/tasks.json

@@ -0,0 +1,47 @@
+{
+    "version": "2.0.0",
+    "tasks": [
+        {
+            "label": "build-windows",
+            "command": "dotnet",
+            "type": "shell",
+            "args": [
+                "build",
+                "${workspaceFolder}/Platforms/Windows/CatapultNetWars.Windows.csproj",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary"
+            ],
+            "group": "build",
+            "presentation": {
+                "echo": true,
+                "reveal": "silent",
+                "focus": false,
+                "panel": "shared",
+                "showReuseMessage": true,
+                "clear": false
+            },
+            "problemMatcher": "$msCompile"
+        },
+        {
+            "label": "build-desktopgl",
+            "command": "dotnet",
+            "type": "shell",
+            "args": [
+                "build",
+                "${workspaceFolder}/Platforms/Desktop/CatapultNetWars.DesktopGL.csproj",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary"
+            ],
+            "group": "build",
+            "presentation": {
+                "echo": true,
+                "reveal": "silent",
+                "focus": false,
+                "panel": "shared",
+                "showReuseMessage": true,
+                "clear": false
+            },
+            "problemMatcher": "$msCompile"
+        }
+    ]
+}

+ 0 - 34
CatapultNetWars/Activity1.cs

@@ -1,34 +0,0 @@
-using System;
-
-using Android.App;
-using Android.Content;
-using Android.Runtime;
-using Android.Views;
-using Android.Widget;
-using Android.OS;
-using Microsoft.Xna.Framework;
-using Android.Content.PM;
-
-namespace CatapultWarsNet
-{
-	
-	[Activity (Label = "CatapultWarsNet"
-	           , MainLauncher = true
-	           ,Icon = "@drawable/icon"
-	           , Theme = "@style/Theme.Splash"
-	           ,ScreenOrientation=ScreenOrientation.Landscape
-	           ,ConfigurationChanges=ConfigChanges.Orientation|ConfigChanges.Keyboard|ConfigChanges.KeyboardHidden)]
-	public class Activity1 : AndroidGameActivity
-	{
-		protected override void OnCreate (Bundle bundle)
-		{
-			base.OnCreate (bundle);
-			CatapultGame.CatapultGame.Activity = this;
-			var g = new CatapultGame.CatapultGame();
-			SetContentView(g.Window);
-			g.Run();
-		}
-	}
-}
-
-

二進制
CatapultNetWars/Background.png


+ 0 - 269
CatapultNetWars/CatapaultNetWars.Windows.csproj

@@ -1,269 +0,0 @@
-<?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)' == '' ">x86</Platform>
-    <ProductVersion>8.0.30703</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{0BCF8950-A28D-4688-BA92-85BD49637ED0}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>CatapaultNetWars</RootNamespace>
-    <AssemblyName>CatapaultNetWars</AssemblyName>
-    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
-    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
-    <FileAlignment>512</FileAlignment>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;WINDOWS</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE;WINDOWS</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="CatapultGame.cs">
-    </Compile>
-    <Compile Include="Utility\Animation.cs">
-    </Compile>
-    <Compile Include="Utility\AudioManager.cs">
-    </Compile>
-    <Compile Include="Screens\BackgroundScreen.cs">
-    </Compile>
-    <Compile Include="Screens\GameplayScreen.cs">
-    </Compile>
-    <Compile Include="Screens\InstructionsScreen.cs">
-    </Compile>
-    <Compile Include="Screens\LoadingScreen.cs">
-    </Compile>
-    <Compile Include="Screens\MainMenuScreen.cs">
-    </Compile>
-    <Compile Include="Screens\MessageBoxScreen.cs">
-    </Compile>
-    <Compile Include="Screens\PauseScreen.cs">
-    </Compile>
-    <Compile Include="ScreenManager\GameScreen.cs">
-    </Compile>
-    <Compile Include="ScreenManager\InputState.cs">
-    </Compile>
-    <Compile Include="ScreenManager\MenuEntry.cs">
-    </Compile>
-    <Compile Include="ScreenManager\MenuScreen.cs">
-    </Compile>
-    <Compile Include="ScreenManager\MouseGestureType.cs">
-    </Compile>
-    <Compile Include="ScreenManager\PlayerIndexEventArgs.cs">
-    </Compile>
-    <Compile Include="ScreenManager\ScreenManager.cs">
-    </Compile>
-    <Compile Include="Players\AI.cs">
-    </Compile>
-    <Compile Include="Players\Human.cs">
-    </Compile>
-    <Compile Include="Players\Player.cs">
-    </Compile>
-    <Compile Include="Networking\AvailableSessionMenuEntry.cs">
-    </Compile>
-    <Compile Include="Networking\CreateOrFindSessionScreen.cs">
-    </Compile>
-    <Compile Include="Networking\JoinSessionScreen.cs">
-    </Compile>
-    <Compile Include="Networking\LobbyScreen.cs">
-    </Compile>
-    <Compile Include="Networking\NetworkBusyScreen.cs">
-    </Compile>
-    <Compile Include="Networking\NetworkErrorScreen.cs">
-    </Compile>
-    <Compile Include="Networking\NetworkSessionComponent.cs">
-    </Compile>
-    <Compile Include="Networking\OperationCompletedEventArgs.cs">
-    </Compile>
-    <Compile Include="Networking\ProfileSignInScreen.cs">
-    </Compile>
-    <Compile Include="Catapult\Catapult.cs">
-    </Compile>
-    <Compile Include="Catapult\Projectile.cs">
-    </Compile>
-    <Compile Include="IMessageDisplay.cs">
-    </Compile>
-    <Compile Include="MessageDisplayComponent.cs">
-    </Compile>
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\Resources.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>Resources.resx</DependentUpon>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\MonoGame.Framework\MonoGame.Framework.WindowsGL.csproj">
-      <Project>{7DE47032-A904-4C29-BD22-2D235E8D91BA}</Project>
-      <Name>MonoGame.Framework.WindowsGL</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\ThirdParty\Lidgren.Network\Lidgren.Network.Windows.csproj">
-      <Project>{AE483C29-042E-4226-BA52-D247CE7676DA}</Project>
-      <Name>Lidgren.Network.Windows</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Content\Fonts\HUDFont.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Fonts\MenuFont.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Ammo\rock_ammo.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\blank.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\cloud1.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\cloud2.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\defeat.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\gameplay_screen.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\instructions.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\mountain.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\sky.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\title_screen.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\victory.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\HUD\ammoType.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\HUD\Arrow.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\HUD\hudBackground.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\HUD\windArrow.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\AnimationsDef.xml">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Fire_Miss\fire_miss.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Hit_Smoke\smoke.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redIdle\redIdle.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\cat.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\chat_able.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\chat_mute.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\chat_ready.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\chat_talking.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\gradient.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Properties\Resources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-    </EmbeddedResource>
-  </ItemGroup>
-  <ItemGroup />
-  <ItemGroup>
-    <Content Include="Content\Sounds\BoulderHit.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\CatapultExplosion.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\CatapultFire.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\Lose.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\RopeStretch.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Sounds\Win.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.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>
-  -->
-</Project>

+ 0 - 337
CatapultNetWars/CatapultNetWars.Android.csproj

@@ -1,337 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{C2B4D7C6-C3C5-4C02-8830-D33C0E59DCDD}</ProjectGuid>
-    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Library</OutputType>
-    <RootNamespace>CatapultWarsNet</RootNamespace>
-    <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
-    <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
-    <AndroidResgenClass>Resource</AndroidResgenClass>
-    <AndroidApplication>True</AndroidApplication>
-    <AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
-    <AssemblyName>CatapultWarsNet</AssemblyName>
-    <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG;ANDROID</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <AndroidLinkMode>None</AndroidLinkMode>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
-    <ConsolePause>False</ConsolePause>
-    <AndroidLinkMode>SdkOnly</AndroidLinkMode>
-    <DefineConstants>ANDROID</DefineConstants>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="Mono.Android" />
-    <Reference Include="OpenTK" />
-    <Reference Include="System.Xml.Linq" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Activity1.cs" />
-    <Compile Include="Resources\Resource.designer.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="CatapultGame.cs">
-      <Link>CatapultGame.cs</Link>
-    </Compile>
-    <Compile Include="Utility\Animation.cs">
-      <Link>Utility\Animation.cs</Link>
-    </Compile>
-    <Compile Include="Utility\AudioManager.cs">
-      <Link>Utility\AudioManager.cs</Link>
-    </Compile>
-    <Compile Include="Screens\BackgroundScreen.cs">
-      <Link>Screens\BackgroundScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\GameplayScreen.cs">
-      <Link>Screens\GameplayScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\InstructionsScreen.cs">
-      <Link>Screens\InstructionsScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\LoadingScreen.cs">
-      <Link>Screens\LoadingScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\MainMenuScreen.cs">
-      <Link>Screens\MainMenuScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\MessageBoxScreen.cs">
-      <Link>Screens\MessageBoxScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\PauseScreen.cs">
-      <Link>Screens\PauseScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\GameScreen.cs">
-      <Link>ScreenManager\GameScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\InputState.cs">
-      <Link>ScreenManager\InputState.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MenuEntry.cs">
-      <Link>ScreenManager\MenuEntry.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MenuScreen.cs">
-      <Link>ScreenManager\MenuScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MouseGestureType.cs">
-      <Link>ScreenManager\MouseGestureType.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\PlayerIndexEventArgs.cs">
-      <Link>ScreenManager\PlayerIndexEventArgs.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\ScreenManager.cs">
-      <Link>ScreenManager\ScreenManager.cs</Link>
-    </Compile>
-    <Compile Include="Players\AI.cs">
-      <Link>Players\AI.cs</Link>
-    </Compile>
-    <Compile Include="Players\Human.cs">
-      <Link>Players\Human.cs</Link>
-    </Compile>
-    <Compile Include="Players\Player.cs">
-      <Link>Players\Player.cs</Link>
-    </Compile>
-    <Compile Include="Networking\AvailableSessionMenuEntry.cs">
-      <Link>Networking\AvailableSessionMenuEntry.cs</Link>
-    </Compile>
-    <Compile Include="Networking\CreateOrFindSessionScreen.cs">
-      <Link>Networking\CreateOrFindSessionScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\JoinSessionScreen.cs">
-      <Link>Networking\JoinSessionScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\LobbyScreen.cs">
-      <Link>Networking\LobbyScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\NetworkBusyScreen.cs">
-      <Link>Networking\NetworkBusyScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\NetworkErrorScreen.cs">
-      <Link>Networking\NetworkErrorScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\NetworkSessionComponent.cs">
-      <Link>Networking\NetworkSessionComponent.cs</Link>
-    </Compile>
-    <Compile Include="Networking\OperationCompletedEventArgs.cs">
-      <Link>Networking\OperationCompletedEventArgs.cs</Link>
-    </Compile>
-    <Compile Include="Networking\ProfileSignInScreen.cs">
-      <Link>Networking\ProfileSignInScreen.cs</Link>
-    </Compile>
-    <Compile Include="Catapult\Catapult.cs">
-      <Link>Catapult\Catapult.cs</Link>
-    </Compile>
-    <Compile Include="Catapult\Projectile.cs">
-      <Link>Catapult\Projectile.cs</Link>
-    </Compile>
-    <Compile Include="IMessageDisplay.cs">
-      <Link>IMessageDisplay.cs</Link>
-    </Compile>
-    <Compile Include="MessageDisplayComponent.cs">
-      <Link>MessageDisplayComponent.cs</Link>
-    </Compile>
-    <Compile Include="Resources.Designer.cs">
-      <Link>Resources.Designer.cs</Link>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Resources\AboutResources.txt" />
-    <None Include="Assets\AboutAssets.txt" />
-    <None Include="Properties\AndroidManifest.xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <AndroidResource Include="Resources\drawable\Icon.png" />
-    <AndroidResource Include="Resources\values\Strings.xml" />
-    <AndroidResource Include="Resources\drawable\Splash.png" />
-    <AndroidResource Include="Resources\values\Styles.xml" />
-    <AndroidResource Include="Resources\drawable-port\Splash.png" />
-  </ItemGroup>
-  <Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
-  <ItemGroup>
-    <Folder Include="Assets\Content\" />
-    <Folder Include="Resources\layout\" />
-    <Folder Include="Resources\values\" />
-    <Folder Include="Catapult\" />
-    <Folder Include="Players\" />
-    <Folder Include="ScreenManager\" />
-    <Folder Include="Screens\" />
-    <Folder Include="Utility\" />
-    <Folder Include="Assets\Content\Fonts\" />
-    <Folder Include="Assets\Content\Sounds\" />
-    <Folder Include="Assets\Content\Textures\" />
-    <Folder Include="Assets\Content\Textures\Ammo\" />
-    <Folder Include="Assets\Content\Textures\Backgrounds\" />
-    <Folder Include="Assets\Content\Textures\HUD\" />
-    <Folder Include="Assets\Content\Textures\Catapults\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Blue\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Fire_Miss\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Hit_Smoke\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Red\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Blue\blueDestroyed\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Blue\blueFire\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Blue\blueIdle\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Blue\bluePullback\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Red\redDestroyed\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Red\redFire\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Red\redIdle\" />
-    <Folder Include="Assets\Content\Textures\Catapults\Red\redPullback\" />
-    <Folder Include="Resources\drawable-port\" />
-  </ItemGroup>
-  <ItemGroup>
-    <AndroidAsset Include="Content\Fonts\HUDFont.xnb">
-      <Link>Assets\Content\Fonts\HUDFont.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Fonts\MenuFont.xnb">
-      <Link>Assets\Content\Fonts\MenuFont.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\BoulderHit.wav">
-      <Link>Assets\Content\Sounds\BoulderHit.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\CatapultExplosion.wav">
-      <Link>Assets\Content\Sounds\CatapultExplosion.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\CatapultFire.wav">
-      <Link>Assets\Content\Sounds\CatapultFire.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\Lose.wav">
-      <Link>Assets\Content\Sounds\Lose.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\RopeStretch.wav">
-      <Link>Assets\Content\Sounds\RopeStretch.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Sounds\Win.wav">
-      <Link>Assets\Content\Sounds\Win.wav</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Ammo\rock_ammo.xnb">
-      <Link>Assets\Content\Textures\Ammo\rock_ammo.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\blank.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\blank.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\cloud1.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\cloud1.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\cloud2.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\cloud2.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\defeat.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\defeat.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\gameplay_screen.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\gameplay_screen.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\instructions.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\instructions.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\mountain.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\mountain.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\sky.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\sky.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\title_screen.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\title_screen.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Backgrounds\victory.xnb">
-      <Link>Assets\Content\Textures\Backgrounds\victory.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\HUD\ammoType.xnb">
-      <Link>Assets\Content\Textures\HUD\ammoType.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\HUD\Arrow.xnb">
-      <Link>Assets\Content\Textures\HUD\Arrow.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\HUD\hudBackground.xnb">
-      <Link>Assets\Content\Textures\HUD\hudBackground.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\HUD\windArrow.xnb">
-      <Link>Assets\Content\Textures\HUD\windArrow.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\AnimationsDef.xml">
-      <Link>Assets\Content\Textures\Catapults\AnimationsDef.xml</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Fire_Miss\fire_miss.xnb">
-      <Link>Assets\Content\Textures\Catapults\Fire_Miss\fire_miss.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Hit_Smoke\smoke.xnb">
-      <Link>Assets\Content\Textures\Catapults\Hit_Smoke\smoke.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb">
-      <Link>Assets\Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb">
-      <Link>Assets\Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb">
-      <Link>Assets\Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb">
-      <Link>Assets\Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb">
-      <Link>Assets\Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb">
-      <Link>Assets\Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Red\redIdle\redIdle.xnb">
-      <Link>Assets\Content\Textures\Catapults\Red\redIdle\redIdle.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb">
-      <Link>Assets\Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\cat.xnb">
-      <Link>Assets\Content\cat.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\chat_able.xnb">
-      <Link>Assets\Content\chat_able.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\chat_mute.xnb">
-      <Link>Assets\Content\chat_mute.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\chat_ready.xnb">
-      <Link>Assets\Content\chat_ready.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\chat_talking.xnb">
-      <Link>Assets\Content\chat_talking.xnb</Link>
-    </AndroidAsset>
-    <AndroidAsset Include="Content\gradient.xnb">
-      <Link>Assets\Content\gradient.xnb</Link>
-    </AndroidAsset>
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Resources.resx">
-      <Link>Resources.resx</Link>
-    </EmbeddedResource>
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\MonoGame.Framework\MonoGame.Framework.Android.csproj">
-      <Project>{BA9476CF-99BA-4D03-92F2-73D2C5E58883}</Project>
-      <Name>MonoGame.Framework.Android</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\ThirdParty\Lidgren.Network\Lidgren.Network.Android.csproj">
-      <Project>{565129E0-4EE5-4F6F-B403-C3484C9740BE}</Project>
-      <Name>Lidgren.Network.Android</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>

+ 0 - 323
CatapultNetWars/CatapultNetWars.Linux.csproj

@@ -1,323 +0,0 @@
-<?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)' == '' ">x86</Platform>
-    <ProductVersion>8.0.30703</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{0BCF8950-A28D-4688-BA92-85BD49637ED0}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>CatapultNetWars</RootNamespace>
-    <AssemblyName>CatapultNetWars</AssemblyName>
-    <FileAlignment>512</FileAlignment>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>TRACE;DEBUG;LINUX</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <PlatformTarget>x86</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
-    <Optimize>True</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE;LINUX</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="CatapultGame.cs">
-      <Link>CatapultGame.cs</Link>
-    </Compile>
-    <Compile Include="Utility\Animation.cs">
-      <Link>Utility\Animation.cs</Link>
-    </Compile>
-    <Compile Include="Utility\AudioManager.cs">
-      <Link>Utility\AudioManager.cs</Link>
-    </Compile>
-    <Compile Include="Screens\BackgroundScreen.cs">
-      <Link>Screens\BackgroundScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\GameplayScreen.cs">
-      <Link>Screens\GameplayScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\InstructionsScreen.cs">
-      <Link>Screens\InstructionsScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\LoadingScreen.cs">
-      <Link>Screens\LoadingScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\MainMenuScreen.cs">
-      <Link>Screens\MainMenuScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\MessageBoxScreen.cs">
-      <Link>Screens\MessageBoxScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\PauseScreen.cs">
-      <Link>Screens\PauseScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\GameScreen.cs">
-      <Link>ScreenManager\GameScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\InputState.cs">
-      <Link>ScreenManager\InputState.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MenuEntry.cs">
-      <Link>ScreenManager\MenuEntry.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MenuScreen.cs">
-      <Link>ScreenManager\MenuScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MouseGestureType.cs">
-      <Link>ScreenManager\MouseGestureType.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\PlayerIndexEventArgs.cs">
-      <Link>ScreenManager\PlayerIndexEventArgs.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\ScreenManager.cs">
-      <Link>ScreenManager\ScreenManager.cs</Link>
-    </Compile>
-    <Compile Include="Players\AI.cs">
-      <Link>Players\AI.cs</Link>
-    </Compile>
-    <Compile Include="Players\Human.cs">
-      <Link>Players\Human.cs</Link>
-    </Compile>
-    <Compile Include="Players\Player.cs">
-      <Link>Players\Player.cs</Link>
-    </Compile>
-    <Compile Include="Networking\AvailableSessionMenuEntry.cs">
-      <Link>Networking\AvailableSessionMenuEntry.cs</Link>
-    </Compile>
-    <Compile Include="Networking\CreateOrFindSessionScreen.cs">
-      <Link>Networking\CreateOrFindSessionScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\JoinSessionScreen.cs">
-      <Link>Networking\JoinSessionScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\LobbyScreen.cs">
-      <Link>Networking\LobbyScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\NetworkBusyScreen.cs">
-      <Link>Networking\NetworkBusyScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\NetworkErrorScreen.cs">
-      <Link>Networking\NetworkErrorScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\NetworkSessionComponent.cs">
-      <Link>Networking\NetworkSessionComponent.cs</Link>
-    </Compile>
-    <Compile Include="Networking\OperationCompletedEventArgs.cs">
-      <Link>Networking\OperationCompletedEventArgs.cs</Link>
-    </Compile>
-    <Compile Include="Networking\ProfileSignInScreen.cs">
-      <Link>Networking\ProfileSignInScreen.cs</Link>
-    </Compile>
-    <Compile Include="Catapult\Catapult.cs">
-      <Link>Catapult\Catapult.cs</Link>
-    </Compile>
-    <Compile Include="Catapult\Projectile.cs">
-      <Link>Catapult\Projectile.cs</Link>
-    </Compile>
-    <Compile Include="IMessageDisplay.cs">
-      <Link>IMessageDisplay.cs</Link>
-    </Compile>
-    <Compile Include="MessageDisplayComponent.cs">
-      <Link>MessageDisplayComponent.cs</Link>
-    </Compile>
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\Resources.Designer.cs">
-      <AutoGen>True</AutoGen>
-      <DesignTime>True</DesignTime>
-      <DependentUpon>Resources.resx</DependentUpon>
-    </Compile>
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Content\Fonts\HUDFont.xnb">
-      <Link>Content\Fonts\HUDFont.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Fonts\MenuFont.xnb">
-      <Link>Content\Fonts\MenuFont.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Ammo\rock_ammo.xnb">
-      <Link>Content\Textures\Ammo\rock_ammo.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\blank.xnb">
-      <Link>Content\Textures\Backgrounds\blank.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\cloud1.xnb">
-      <Link>Content\Textures\Backgrounds\cloud1.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\cloud2.xnb">
-      <Link>Content\Textures\Backgrounds\cloud2.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\defeat.xnb">
-      <Link>Content\Textures\Backgrounds\defeat.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\gameplay_screen.xnb">
-      <Link>Content\Textures\Backgrounds\gameplay_screen.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\instructions.xnb">
-      <Link>Content\Textures\Backgrounds\instructions.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\mountain.xnb">
-      <Link>Content\Textures\Backgrounds\mountain.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\sky.xnb">
-      <Link>Content\Textures\Backgrounds\sky.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\title_screen.xnb">
-      <Link>Content\Textures\Backgrounds\title_screen.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\victory.xnb">
-      <Link>Content\Textures\Backgrounds\victory.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\HUD\ammoType.xnb">
-      <Link>Content\Textures\HUD\ammoType.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\HUD\Arrow.xnb">
-      <Link>Content\Textures\HUD\Arrow.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\HUD\hudBackground.xnb">
-      <Link>Content\Textures\HUD\hudBackground.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\HUD\windArrow.xnb">
-      <Link>Content\Textures\HUD\windArrow.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\AnimationsDef.xml">
-      <Link>Content\Textures\Catapults\AnimationsDef.xml</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Fire_Miss\fire_miss.xnb">
-      <Link>Content\Textures\Catapults\Fire_Miss\fire_miss.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Hit_Smoke\smoke.xnb">
-      <Link>Content\Textures\Catapults\Hit_Smoke\smoke.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb">
-      <Link>Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb">
-      <Link>Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb">
-      <Link>Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb">
-      <Link>Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb">
-      <Link>Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb">
-      <Link>Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redIdle\redIdle.xnb">
-      <Link>Content\Textures\Catapults\Red\redIdle\redIdle.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb">
-      <Link>Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\cat.xnb">
-      <Link>Content\cat.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\chat_able.xnb">
-      <Link>Content\chat_able.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\chat_mute.xnb">
-      <Link>Content\chat_mute.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\chat_ready.xnb">
-      <Link>Content\chat_ready.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\chat_talking.xnb">
-      <Link>Content\chat_talking.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\gradient.xnb">
-      <Link>Content\gradient.xnb</Link>
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Properties\Resources.resx">
-      <Generator>ResXFileCodeGenerator</Generator>
-      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
-    </EmbeddedResource>
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.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>
-  -->
-  <ItemGroup>
-    <None Include="Content\Sounds\BoulderHit.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Content\Sounds\CatapultExplosion.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Content\Sounds\CatapultFire.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Content\Sounds\Lose.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Content\Sounds\RopeStretch.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-    <None Include="Content\Sounds\Win.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </None>
-  </ItemGroup>
-</Project>

+ 0 - 155
CatapultNetWars/CatapultNetWars.MacOS.csproj

@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{1F4BF87D-34DA-417D-96DE-24213A05739B}</ProjectGuid>
-    <ProjectTypeGuids>{948B3504-5B70-4649-8FE4-BDE1FB46EC69};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>CatapultGame</RootNamespace>
-    <AssemblyName>Catapault</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG; MONOMAC</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <ConsolePause>False</ConsolePause>
-    <EnableCodeSigning>False</EnableCodeSigning>
-    <CreatePackage>False</CreatePackage>
-    <EnablePackageSigning>False</EnablePackageSigning>
-    <IncludeMonoRuntime>False</IncludeMonoRuntime>
-    <UseSGen>False</UseSGen>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <ConsolePause>False</ConsolePause>
-    <EnableCodeSigning>False</EnableCodeSigning>
-    <CreatePackage>False</CreatePackage>
-    <EnablePackageSigning>False</EnablePackageSigning>
-    <IncludeMonoRuntime>False</IncludeMonoRuntime>
-    <UseSGen>False</UseSGen>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Drawing" />
-    <Reference Include="MonoMac" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Info.plist">
-    </None>
-    <None Include="Background.png" />
-    <None Include="Game.ico" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
-  <ItemGroup>
-    <Compile Include="CatapultGame.cs" />
-    <Compile Include="Program.cs" />
-    <Compile Include="Catapult\Catapult.cs" />
-    <Compile Include="Catapult\Projectile.cs" />
-    <Compile Include="Players\AI.cs" />
-    <Compile Include="Players\Human.cs" />
-    <Compile Include="Players\Player.cs" />
-    <Compile Include="ScreenManager\GameScreen.cs" />
-    <Compile Include="ScreenManager\InputState.cs" />
-    <Compile Include="ScreenManager\MenuEntry.cs" />
-    <Compile Include="ScreenManager\MenuScreen.cs" />
-    <Compile Include="ScreenManager\PlayerIndexEventArgs.cs" />
-    <Compile Include="ScreenManager\ScreenManager.cs" />
-    <Compile Include="Screens\BackgroundScreen.cs" />
-    <Compile Include="Screens\GameplayScreen.cs" />
-    <Compile Include="Screens\InstructionsScreen.cs" />
-    <Compile Include="Screens\MainMenuScreen.cs" />
-    <Compile Include="Screens\PauseScreen.cs" />
-    <Compile Include="Utility\Animation.cs" />
-    <Compile Include="Utility\AudioManager.cs" />
-    <Compile Include="ScreenManager\MouseGestureType.cs" />
-    <Compile Include="IMessageDisplay.cs" />
-    <Compile Include="MessageDisplayComponent.cs" />
-    <Compile Include="Networking\AvailableSessionMenuEntry.cs" />
-    <Compile Include="Networking\CreateOrFindSessionScreen.cs" />
-    <Compile Include="Networking\JoinSessionScreen.cs" />
-    <Compile Include="Networking\LobbyScreen.cs" />
-    <Compile Include="Networking\NetworkBusyScreen.cs" />
-    <Compile Include="Networking\NetworkErrorScreen.cs" />
-    <Compile Include="Networking\NetworkSessionComponent.cs" />
-    <Compile Include="Networking\OperationCompletedEventArgs.cs" />
-    <Compile Include="Networking\ProfileSignInScreen.cs" />
-    <Compile Include="Resources.Designer.cs" />
-    <Compile Include="Screens\LoadingScreen.cs" />
-    <Compile Include="Screens\MessageBoxScreen.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Content\Fonts\HUDFont.xnb" />
-    <Content Include="Content\Fonts\MenuFont.xnb" />
-    <Content Include="Content\Sounds\BoulderHit.xnb" />
-    <Content Include="Content\Sounds\CatapultExplosion.xnb" />
-    <Content Include="Content\Sounds\CatapultFire.xnb" />
-    <Content Include="Content\Sounds\Lose.xnb" />
-    <Content Include="Content\Sounds\RopeStretch.xnb" />
-    <Content Include="Content\Sounds\Win.xnb" />
-    <Content Include="Content\Textures\Ammo\rock_ammo.xnb" />
-    <Content Include="Content\Textures\Backgrounds\blank.xnb" />
-    <Content Include="Content\Textures\Backgrounds\cloud1.xnb" />
-    <Content Include="Content\Textures\Backgrounds\cloud2.xnb" />
-    <Content Include="Content\Textures\Backgrounds\defeat.xnb" />
-    <Content Include="Content\Textures\Backgrounds\gameplay_screen.xnb" />
-    <Content Include="Content\Textures\Backgrounds\instructions.xnb" />
-    <Content Include="Content\Textures\Backgrounds\mountain.xnb" />
-    <Content Include="Content\Textures\Backgrounds\sky.xnb" />
-    <Content Include="Content\Textures\Backgrounds\title_screen.xnb" />
-    <Content Include="Content\Textures\Backgrounds\victory.xnb" />
-    <Content Include="Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb" />
-    <Content Include="Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb" />
-    <Content Include="Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb" />
-    <Content Include="Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb" />
-    <Content Include="Content\Textures\Catapults\Fire_Miss\fire_miss.xnb" />
-    <Content Include="Content\Textures\Catapults\Hit_Smoke\smoke.xnb" />
-    <Content Include="Content\Textures\Catapults\AnimationsDef.xml" />
-    <Content Include="Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb" />
-    <Content Include="Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb" />
-    <Content Include="Content\Textures\Catapults\Red\redIdle\redIdle.xnb" />
-    <Content Include="Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb" />
-    <Content Include="Content\Textures\HUD\Arrow.xnb" />
-    <Content Include="Content\Textures\HUD\ammoType.xnb" />
-    <Content Include="Content\Textures\HUD\hudBackground.xnb" />
-    <Content Include="Content\Textures\HUD\windArrow.xnb" />
-    <Content Include="Content\gradient.xnb" />
-    <Content Include="Content\cat.xnb" />
-    <Content Include="Content\chat_able.xnb" />
-    <Content Include="Content\chat_mute.xnb" />
-    <Content Include="Content\chat_ready.xnb" />
-    <Content Include="Content\chat_talking.xnb" />
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Networking\" />
-  </ItemGroup>
-  <ItemGroup>
-    <EmbeddedResource Include="Resources.resx" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\MonoGame.Framework\MonoGame.Framework.MacOS.csproj">
-      <Project>{36C538E6-C32A-4A8D-A39C-566173D7118E}</Project>
-      <Name>MonoGame.Framework.MacOS</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\ThirdParty\Lidgren.Network\Lidgren.Network.MacOS.csproj">
-      <Project>{AE483C29-042E-4226-BA52-D247CE7676DA}</Project>
-      <Name>Lidgren.Network.MacOS</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>

+ 0 - 311
CatapultNetWars/CatapultNetWars.iOS.csproj

@@ -1,311 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
-    <ProductVersion>10.0.0</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{65DE6FC7-CB94-4E4F-8FBE-E3EA9A34967C}</ProjectGuid>
-    <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>MonoGame.Samples.CatapultNetWars</RootNamespace>
-    <AssemblyName>MonoGameSamplesCatapultNetWars</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
-    <DefineConstants>DEBUG;IPHONE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <MtouchDebug>True</MtouchDebug>
-    <MtouchProfiling>True</MtouchProfiling>
-    <MtouchLink>None</MtouchLink>
-    <MtouchI18n />
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <MtouchLink>None</MtouchLink>
-    <DefineConstants>IPHONE</DefineConstants>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
-    <DebugSymbols>True</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhone\Debug</OutputPath>
-    <DefineConstants>DEBUG;IPHONE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <CodesignKey>iPhone Developer</CodesignKey>
-    <MtouchDebug>True</MtouchDebug>
-    <MtouchProfiling>True</MtouchProfiling>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
-    <DebugType>none</DebugType>
-    <Optimize>False</Optimize>
-    <OutputPath>bin\iPhone\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <ConsolePause>False</ConsolePause>
-    <CodesignKey>iPhone Developer</CodesignKey>
-    <DefineConstants>IPHONE</DefineConstants>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="monotouch" />
-    <Reference Include="OpenTK" />
-    <Reference Include="System.Xml.Linq" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="Info.iOS.plist">
-      <Link>Info.plist</Link>
-    </None>
-    <None Include="Resources.resources">
-      <Link>Resources.resources</Link>
-    </None>
-    <None Include="Resources.resx">
-      <Link>Resources.resx</Link>
-    </None>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="CatapultGame.cs">
-      <Link>CatapultGame.cs</Link>
-    </Compile>
-    <Compile Include="IMessageDisplay.cs">
-      <Link>IMessageDisplay.cs</Link>
-    </Compile>
-    <Compile Include="MessageDisplayComponent.cs">
-      <Link>MessageDisplayComponent.cs</Link>
-    </Compile>
-    <Compile Include="Catapult\Catapult.cs">
-      <Link>Catapult\Catapult.cs</Link>
-    </Compile>
-    <Compile Include="Catapult\Projectile.cs">
-      <Link>Catapult\Projectile.cs</Link>
-    </Compile>
-    <Compile Include="Networking\AvailableSessionMenuEntry.cs">
-      <Link>Networking\AvailableSessionMenuEntry.cs</Link>
-    </Compile>
-    <Compile Include="Networking\CreateOrFindSessionScreen.cs">
-      <Link>Networking\CreateOrFindSessionScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\JoinSessionScreen.cs">
-      <Link>Networking\JoinSessionScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\LobbyScreen.cs">
-      <Link>Networking\LobbyScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\NetworkBusyScreen.cs">
-      <Link>Networking\NetworkBusyScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\NetworkErrorScreen.cs">
-      <Link>Networking\NetworkErrorScreen.cs</Link>
-    </Compile>
-    <Compile Include="Networking\NetworkSessionComponent.cs">
-      <Link>Networking\NetworkSessionComponent.cs</Link>
-    </Compile>
-    <Compile Include="Networking\OperationCompletedEventArgs.cs">
-      <Link>Networking\OperationCompletedEventArgs.cs</Link>
-    </Compile>
-    <Compile Include="Networking\ProfileSignInScreen.cs">
-      <Link>Networking\ProfileSignInScreen.cs</Link>
-    </Compile>
-    <Compile Include="Players\AI.cs">
-      <Link>Players\AI.cs</Link>
-    </Compile>
-    <Compile Include="Players\Human.cs">
-      <Link>Players\Human.cs</Link>
-    </Compile>
-    <Compile Include="Players\Player.cs">
-      <Link>Players\Player.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\GameScreen.cs">
-      <Link>ScreenManager\GameScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\InputState.cs">
-      <Link>ScreenManager\InputState.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MenuEntry.cs">
-      <Link>ScreenManager\MenuEntry.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MenuScreen.cs">
-      <Link>ScreenManager\MenuScreen.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\MouseGestureType.cs">
-      <Link>ScreenManager\MouseGestureType.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\PlayerIndexEventArgs.cs">
-      <Link>ScreenManager\PlayerIndexEventArgs.cs</Link>
-    </Compile>
-    <Compile Include="ScreenManager\ScreenManager.cs">
-      <Link>ScreenManager\ScreenManager.cs</Link>
-    </Compile>
-    <Compile Include="Screens\BackgroundScreen.cs">
-      <Link>Screens\BackgroundScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\GameplayScreen.cs">
-      <Link>Screens\GameplayScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\InstructionsScreen.cs">
-      <Link>Screens\InstructionsScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\LoadingScreen.cs">
-      <Link>Screens\LoadingScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\MainMenuScreen.cs">
-      <Link>Screens\MainMenuScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\MessageBoxScreen.cs">
-      <Link>Screens\MessageBoxScreen.cs</Link>
-    </Compile>
-    <Compile Include="Screens\PauseScreen.cs">
-      <Link>Screens\PauseScreen.cs</Link>
-    </Compile>
-    <Compile Include="Utility\Animation.cs">
-      <Link>Utility\Animation.cs</Link>
-    </Compile>
-    <Compile Include="Utility\AudioManager.cs">
-      <Link>Utility\AudioManager.cs</Link>
-    </Compile>
-    <Compile Include="Resources.Designer.cs">
-      <Link>Resources.Designer.cs</Link>
-    </Compile>
-    <Compile Include="Program.cs" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <ItemGroup>
-    <Content Include="Background.png">
-      <Link>Background.png</Link>
-    </Content>
-    <Content Include="Content\cat.xnb">
-      <Link>Content\cat.xnb</Link>
-    </Content>
-    <Content Include="Content\chat_able.xnb">
-      <Link>Content\chat_able.xnb</Link>
-    </Content>
-    <Content Include="Content\chat_mute.xnb">
-      <Link>Content\chat_mute.xnb</Link>
-    </Content>
-    <Content Include="Content\chat_ready.xnb">
-      <Link>Content\chat_ready.xnb</Link>
-    </Content>
-    <Content Include="Content\chat_talking.xnb">
-      <Link>Content\chat_talking.xnb</Link>
-    </Content>
-    <Content Include="Content\gradient.xnb">
-      <Link>Content\gradient.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\HUD\ammoType.xnb">
-      <Link>Content\Textures\HUD\ammoType.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\HUD\Arrow.xnb">
-      <Link>Content\Textures\HUD\Arrow.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\HUD\hudBackground.xnb">
-      <Link>Content\Textures\HUD\hudBackground.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\HUD\windArrow.xnb">
-      <Link>Content\Textures\HUD\windArrow.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\AnimationsDef.xml">
-      <Link>Content\Textures\Catapults\AnimationsDef.xml</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb">
-      <Link>Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redIdle\redIdle.xnb">
-      <Link>Content\Textures\Catapults\Red\redIdle\redIdle.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb">
-      <Link>Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb">
-      <Link>Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Hit_Smoke\smoke.xnb">
-      <Link>Content\Textures\Catapults\Hit_Smoke\smoke.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Fire_Miss\fire_miss.xnb">
-      <Link>Content\Textures\Catapults\Fire_Miss\fire_miss.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb">
-      <Link>Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb">
-      <Link>Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb">
-      <Link>Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb">
-      <Link>Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\blank.xnb">
-      <Link>Content\Textures\Backgrounds\blank.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\cloud1.xnb">
-      <Link>Content\Textures\Backgrounds\cloud1.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\cloud2.xnb">
-      <Link>Content\Textures\Backgrounds\cloud2.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\defeat.xnb">
-      <Link>Content\Textures\Backgrounds\defeat.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\gameplay_screen.xnb">
-      <Link>Content\Textures\Backgrounds\gameplay_screen.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\instructions.xnb">
-      <Link>Content\Textures\Backgrounds\instructions.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\mountain.xnb">
-      <Link>Content\Textures\Backgrounds\mountain.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\sky.xnb">
-      <Link>Content\Textures\Backgrounds\sky.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\title_screen.xnb">
-      <Link>Content\Textures\Backgrounds\title_screen.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Backgrounds\victory.xnb">
-      <Link>Content\Textures\Backgrounds\victory.xnb</Link>
-    </Content>
-    <Content Include="Content\Textures\Ammo\rock_ammo.xnb">
-      <Link>Content\Textures\Ammo\rock_ammo.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\Win.xnb">
-      <Link>Content\Sounds\Win.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\Lose.xnb">
-      <Link>Content\Sounds\Lose.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\RopeStretch.xnb">
-      <Link>Content\Sounds\RopeStretch.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\CatapultFire.xnb">
-      <Link>Content\Sounds\CatapultFire.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\CatapultExplosion.xnb">
-      <Link>Content\Sounds\CatapultExplosion.xnb</Link>
-    </Content>
-    <Content Include="Content\Sounds\BoulderHit.xnb">
-      <Link>Content\Sounds\BoulderHit.xnb</Link>
-    </Content>
-    <Content Include="Content\Fonts\HUDFont.xnb">
-      <Link>Content\Fonts\HUDFont.xnb</Link>
-    </Content>
-    <Content Include="Content\Fonts\MenuFont.xnb">
-      <Link>Content\Fonts\MenuFont.xnb</Link>
-    </Content>
-  </ItemGroup>
-</Project>

+ 48 - 26
CatapultNetWars/CatapultNetWars.sln

@@ -1,37 +1,59 @@
 
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CatapultNetWars", "CatapultNetWars.csproj", "{1F4BF77D-34DA-417D-96DE-24213A05729B}"
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CatapultNetWars.Core", "Core\CatapultNetWars.Core.csproj", "{2D6B149A-DED5-BD6D-92E9-06F37A7E8D03}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Framework.MacOS", "..\..\..\..\..\..\..\Users\Jimmy\Public\Share\MonoMacSource\kjpgit\MonoGame\MonoGame.Framework\MonoGame.Framework.MacOS.csproj", "{36C538E6-C32A-4A8D-A39C-566173D7118E}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Xna.Framework.Net", "..\MonoGame.Xna.Framework.Net\MonoGame.Xna.Framework.Net.csproj", "{86E1E7AD-DD62-384D-A073-092A5F875CF0}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lidgren.Network.MacOS", "..\..\..\..\..\..\..\Users\Jimmy\Public\Share\MonoMacSource\kjpgit\MonoGame\ThirdParty\Lidgren.Network\Lidgren.Network.MacOS.csproj", "{AE483C29-042E-4226-BA52-D247CE7676DA}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CatapultNetWars.Android", "Platforms\Android\CatapultNetWars.Android.csproj", "{7DF9E0D3-84A7-8FD3-949C-4AB7CE0DE1B2}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CatapultNetWars.DesktopGL", "Platforms\Desktop\CatapultNetWars.DesktopGL.csproj", "{AC584BCF-4638-73F6-7635-82F08B9F3C66}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CatapultNetWars.iOS", "Platforms\iOS\CatapultNetWars.iOS.csproj", "{B86B684A-F505-89DA-4694-9C61E1C87EE8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CatapultNetWars.Windows", "Platforms\Windows\CatapultNetWars.Windows.csproj", "{B2676159-C59D-CA93-EBBC-F1984D0F95A5}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|x86 = Debug|x86
-		Release|x86 = Release|x86
-		Distribution|Any CPU = Distribution|Any CPU
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{1F4BF77D-34DA-417D-96DE-24213A05729B}.Debug|x86.ActiveCfg = Debug|x86
-		{1F4BF77D-34DA-417D-96DE-24213A05729B}.Debug|x86.Build.0 = Debug|x86
-		{1F4BF77D-34DA-417D-96DE-24213A05729B}.Release|x86.ActiveCfg = Release|x86
-		{1F4BF77D-34DA-417D-96DE-24213A05729B}.Release|x86.Build.0 = Release|x86
-		{36C538E6-C32A-4A8D-A39C-566173D7118E}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{36C538E6-C32A-4A8D-A39C-566173D7118E}.Debug|x86.Build.0 = Debug|Any CPU
-		{36C538E6-C32A-4A8D-A39C-566173D7118E}.Distribution|Any CPU.ActiveCfg = Distribution|Any CPU
-		{36C538E6-C32A-4A8D-A39C-566173D7118E}.Distribution|Any CPU.Build.0 = Distribution|Any CPU
-		{36C538E6-C32A-4A8D-A39C-566173D7118E}.Release|x86.ActiveCfg = Release|Any CPU
-		{36C538E6-C32A-4A8D-A39C-566173D7118E}.Release|x86.Build.0 = Release|Any CPU
-		{AE483C29-042E-4226-BA52-D247CE7676DA}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{AE483C29-042E-4226-BA52-D247CE7676DA}.Debug|x86.Build.0 = Debug|Any CPU
-		{AE483C29-042E-4226-BA52-D247CE7676DA}.Distribution|Any CPU.ActiveCfg = Debug|Any CPU
-		{AE483C29-042E-4226-BA52-D247CE7676DA}.Distribution|Any CPU.Build.0 = Debug|Any CPU
-		{AE483C29-042E-4226-BA52-D247CE7676DA}.Release|x86.ActiveCfg = Release|Any CPU
-		{AE483C29-042E-4226-BA52-D247CE7676DA}.Release|x86.Build.0 = Release|Any CPU
+		{2D6B149A-DED5-BD6D-92E9-06F37A7E8D03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{2D6B149A-DED5-BD6D-92E9-06F37A7E8D03}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{2D6B149A-DED5-BD6D-92E9-06F37A7E8D03}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{2D6B149A-DED5-BD6D-92E9-06F37A7E8D03}.Release|Any CPU.Build.0 = Release|Any CPU
+		{86E1E7AD-DD62-384D-A073-092A5F875CF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{86E1E7AD-DD62-384D-A073-092A5F875CF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{86E1E7AD-DD62-384D-A073-092A5F875CF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{86E1E7AD-DD62-384D-A073-092A5F875CF0}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7DF9E0D3-84A7-8FD3-949C-4AB7CE0DE1B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7DF9E0D3-84A7-8FD3-949C-4AB7CE0DE1B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7DF9E0D3-84A7-8FD3-949C-4AB7CE0DE1B2}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+		{7DF9E0D3-84A7-8FD3-949C-4AB7CE0DE1B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7DF9E0D3-84A7-8FD3-949C-4AB7CE0DE1B2}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7DF9E0D3-84A7-8FD3-949C-4AB7CE0DE1B2}.Release|Any CPU.Deploy.0 = Release|Any CPU
+		{AC584BCF-4638-73F6-7635-82F08B9F3C66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{AC584BCF-4638-73F6-7635-82F08B9F3C66}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{AC584BCF-4638-73F6-7635-82F08B9F3C66}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{AC584BCF-4638-73F6-7635-82F08B9F3C66}.Release|Any CPU.Build.0 = Release|Any CPU
+		{B86B684A-F505-89DA-4694-9C61E1C87EE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{B86B684A-F505-89DA-4694-9C61E1C87EE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{B86B684A-F505-89DA-4694-9C61E1C87EE8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+		{B86B684A-F505-89DA-4694-9C61E1C87EE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{B86B684A-F505-89DA-4694-9C61E1C87EE8}.Release|Any CPU.Build.0 = Release|Any CPU
+		{B86B684A-F505-89DA-4694-9C61E1C87EE8}.Release|Any CPU.Deploy.0 = Release|Any CPU
+		{B2676159-C59D-CA93-EBBC-F1984D0F95A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{B2676159-C59D-CA93-EBBC-F1984D0F95A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{B2676159-C59D-CA93-EBBC-F1984D0F95A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{B2676159-C59D-CA93-EBBC-F1984D0F95A5}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
 	EndGlobalSection
-	GlobalSection(MonoDevelopProperties) = preSolution
-		StartupItem = CatapultNetWars.csproj
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {A1B2C3D4-E5F6-7890-ABCD-EF1234567890}
 	EndGlobalSection
 EndGlobal

二進制
CatapultNetWars/Content/Fonts/HUDFont.xnb


二進制
CatapultNetWars/Content/Fonts/MenuFont.xnb


二進制
CatapultNetWars/Content/Sounds/BoulderHit.wav


二進制
CatapultNetWars/Content/Sounds/BoulderHit.xnb


二進制
CatapultNetWars/Content/Sounds/CatapultExplosion.wav


二進制
CatapultNetWars/Content/Sounds/CatapultExplosion.xnb


二進制
CatapultNetWars/Content/Sounds/CatapultFire.wav


二進制
CatapultNetWars/Content/Sounds/CatapultFire.xnb


二進制
CatapultNetWars/Content/Sounds/Lose.wav


二進制
CatapultNetWars/Content/Sounds/Lose.xnb


二進制
CatapultNetWars/Content/Sounds/RopeStretch.wav


二進制
CatapultNetWars/Content/Sounds/RopeStretch.xnb


二進制
CatapultNetWars/Content/Sounds/Win.wav


二進制
CatapultNetWars/Content/Sounds/Win.xnb


二進制
CatapultNetWars/Content/Textures/Ammo/rock_ammo.xnb


二進制
CatapultNetWars/Content/Textures/Backgrounds/blank.xnb


二進制
CatapultNetWars/Content/Textures/Backgrounds/cloud1.xnb


二進制
CatapultNetWars/Content/Textures/Backgrounds/cloud2.xnb


二進制
CatapultNetWars/Content/Textures/Backgrounds/defeat.xnb


二進制
CatapultNetWars/Content/Textures/Backgrounds/gameplay_screen.xnb


二進制
CatapultNetWars/Content/Textures/Backgrounds/instructions.xnb


二進制
CatapultNetWars/Content/Textures/Backgrounds/mountain.xnb


二進制
CatapultNetWars/Content/Textures/Backgrounds/sky.xnb


二進制
CatapultNetWars/Content/Textures/Backgrounds/title_screen.xnb


二進制
CatapultNetWars/Content/Textures/Backgrounds/victory.xnb


二進制
CatapultNetWars/Content/Textures/Catapults/Blue/blueDestroyed/blueCatapult_destroyed.xnb


二進制
CatapultNetWars/Content/Textures/Catapults/Blue/blueFire/blueCatapult_fire.xnb


二進制
CatapultNetWars/Content/Textures/Catapults/Blue/blueIdle/blueIdle.xnb


二進制
CatapultNetWars/Content/Textures/Catapults/Blue/bluePullback/blueCatapult_Pullback.xnb


二進制
CatapultNetWars/Content/Textures/Catapults/Fire_Miss/fire_miss.xnb


二進制
CatapultNetWars/Content/Textures/Catapults/Hit_Smoke/smoke.xnb


二進制
CatapultNetWars/Content/Textures/Catapults/Red/redDestroyed/redCatapult_destroyed.xnb


二進制
CatapultNetWars/Content/Textures/Catapults/Red/redFire/redCatapult_fire.xnb


二進制
CatapultNetWars/Content/Textures/Catapults/Red/redIdle/redIdle.xnb


二進制
CatapultNetWars/Content/Textures/Catapults/Red/redPullback/redCatapult_Pullback.xnb


二進制
CatapultNetWars/Content/Textures/HUD/Arrow.xnb


二進制
CatapultNetWars/Content/Textures/HUD/ammoType.xnb


二進制
CatapultNetWars/Content/Textures/HUD/hudBackground.xnb


二進制
CatapultNetWars/Content/Textures/HUD/windArrow.xnb


+ 585 - 603
CatapultNetWars/Catapult/Catapult.cs → CatapultNetWars/Core/Catapult/Catapult.cs

@@ -1,603 +1,585 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// Catapult.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region File Information
-//-----------------------------------------------------------------------------
-// Animation.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input.Touch;
-//using Microsoft.Devices;
-using System.Xml.Linq;
-#endregion
-
-namespace CatapultGame
-{
-    #region Catapult states definition enum
-    [Flags]
-    public enum CatapultState
-    {
-        Idle = 0x0,
-        Aiming = 0x1,
-        Firing = 0x2,
-        ProjectileFlying = 0x4,
-        ProjectileHit = 0x8,
-        Hit = 0x10,
-        Reset = 0x20,
-        Stalling = 0x40
-    }
-    #endregion
-
-    public class Catapult : DrawableGameComponent
-    {
-        #region Variables/Fields and Properties
-        // Hold what the game to which the catapult belongs
-        CatapultGame curGame = null;
-
-        SpriteBatch spriteBatch;
-        Random random;
-
-        public bool AnimationRunning { get; set; }
-        public string Name { get; set; }
-        public bool IsActive { get; set; }
-
-        // In some cases the game need to start second animation while first animation is still running;
-        // this variable define at which frame the second animation should start
-        Dictionary<string, int> splitFrames;
-
-        Texture2D idleTexture;
-        Dictionary<string, Animation> animations;
-
-        SpriteEffects spriteEffects;
-
-        // Projectile
-        Projectile projectile;
-
-        string idleTextureName;
-        bool isAI;
-
-        // Game constants
-        const float gravity = 500f;
-
-        // State of the catapult during its last update
-        CatapultState lastUpdateState = CatapultState.Idle;
-
-        // Used to stall animations
-        int stallUpdateCycles;
-
-        // Current state of the Catapult
-        CatapultState currentState;
-        public CatapultState CurrentState
-        {
-            get { return currentState; }
-            set { currentState = value; }
-        }
-
-        float wind;
-        public float Wind
-        {
-            set
-            {
-                wind = value;
-            }
-        }
-
-        Player enemy;
-        internal Player Enemy
-        {
-            set
-            {
-                enemy = value;
-            }
-        }
-
-        Player self;
-        internal Player Self
-        {
-            set
-            {
-                self = value;
-            }
-        }
-
-        Vector2 catapultPosition;
-        public Vector2 Position
-        {
-            get
-            {
-                return catapultPosition;
-            }
-        }
-
-        /// <summary>
-        /// Describes how powerful the current shot being fired is. The more powerful
-        /// the shot, the further it goes. 0 is the weakest, 1 is the strongest.
-        /// </summary>
-        public float ShotStrength { get; set; }
-
-        public float ShotVelocity { get; set; }
-
-        /// <summary>
-        /// Used to determine whether or not the game is over
-        /// </summary>
-        public bool GameOver { get; set; }
-
-        const int winScore = 5;
-        #endregion
-
-        #region Initialization
-        public Catapult(Game game)
-            : base(game)
-        {
-            curGame = (CatapultGame)game;
-        }
-
-        public Catapult(Game game, SpriteBatch screenSpriteBatch,
-          string IdleTexture,
-          Vector2 CatapultPosition, SpriteEffects SpriteEffect, bool IsAI)
-            : this(game)
-        {
-            idleTextureName = IdleTexture;
-            catapultPosition = CatapultPosition;
-            spriteEffects = SpriteEffect;
-            spriteBatch = screenSpriteBatch;
-            isAI = IsAI;
-
-            splitFrames = new Dictionary<string, int>();
-            animations = new Dictionary<string, Animation>();
-        }
-
-        /// <summary>
-        /// Function initializes the catapult instance and loads the animations from XML definition sheet
-        /// </summary>
-        public override void Initialize()
-        {
-            // Define initial state of the catapult
-            IsActive = true;
-            AnimationRunning = false;
-            currentState = CatapultState.Idle;
-            stallUpdateCycles = 0;
-			
-			// Load multiple animations form XML definition
-			XDocument doc = null;
-#if ANDROID
-			using(var stream = Game.Activity.Assets.Open(@"Content/Textures/Catapults/AnimationsDef.xml"))
-			{
-				doc = XDocument.Load(stream);
-			}
-#else			
-            doc = XDocument.Load("Content/Textures/Catapults/AnimationsDef.xml");            
-#endif				            
-            XName name = XName.Get("Definition");
-            var definitions = doc.Document.Descendants(name);
-
-            // Loop over all definitions in XML
-            foreach (var animationDefinition in definitions)
-            {
-                bool? toLoad = null;
-                bool val;
-                if (bool.TryParse(animationDefinition.Attribute("IsAI").Value, out val))
-                    toLoad = val;
-
-                // Check if the animation definition need to be loaded for current catapult
-                if (toLoad == isAI || null == toLoad)
-                {
-                    // Get a name of the animation
-                    string animatonAlias = animationDefinition.Attribute("Alias").Value;
-                    Texture2D texture =
-                        curGame.Content.Load<Texture2D>(animationDefinition.Attribute("SheetName").Value);
-
-                    // Get the frame size (width & height)
-                    Point frameSize = new Point();
-                    frameSize.X = int.Parse(animationDefinition.Attribute("FrameWidth").Value);
-                    frameSize.Y = int.Parse(animationDefinition.Attribute("FrameHeight").Value);
-
-                    // Get the frames sheet dimensions
-                    Point sheetSize = new Point();
-                    sheetSize.X = int.Parse(animationDefinition.Attribute("SheetColumns").Value);
-                    sheetSize.Y = int.Parse(animationDefinition.Attribute("SheetRows").Value);
-
-                    // If definition has a "SplitFrame" - means that other animation should start here - load it
-                    if (null != animationDefinition.Attribute("SplitFrame"))
-                        splitFrames.Add(animatonAlias,
-                            int.Parse(animationDefinition.Attribute("SplitFrame").Value));
-
-                    // Defing animation speed
-                    TimeSpan frameInterval = TimeSpan.FromSeconds((float)1 /
-                        int.Parse(animationDefinition.Attribute("Speed").Value));
-
-                    Animation animation = new Animation(texture, frameSize, sheetSize);
-
-                    // If definition has an offset defined - means that it should be rendered relatively
-                    // to some element/other animation - load it
-                    if (null != animationDefinition.Attribute("OffsetX") &&
-                      null != animationDefinition.Attribute("OffsetY"))
-                    {
-                        animation.Offset = new Vector2(int.Parse(animationDefinition.Attribute("OffsetX").Value),
-                            int.Parse(animationDefinition.Attribute("OffsetY").Value));
-                    }
-
-                    animations.Add(animatonAlias, animation);
-                }
-            }
-
-            // Load the textures
-            idleTexture = curGame.Content.Load<Texture2D>(idleTextureName);
-
-            // Initialize the projectile
-            Vector2 projectileStartPosition;
-            if (isAI)
-                projectileStartPosition = new Vector2(630, 340);
-            else
-                projectileStartPosition = new Vector2(175, 340);
-
-            projectile = new Projectile(curGame, spriteBatch, "Textures/Ammo/rock_ammo",
-              projectileStartPosition, animations["Fire"].FrameSize.Y, isAI, gravity);
-            projectile.Initialize();
-
-            // Initialize randomizer
-            random = new Random();
-
-            base.Initialize();
-        }
-        #endregion
-
-        #region Update and Render
-        public override void Update(GameTime gameTime)
-        {
-            bool isGroundHit;
-            bool startStall;
-            CatapultState postUpdateStateChange = 0;
-
-            if (gameTime == null)
-                throw new ArgumentNullException("gameTime");
-
-            // The catapult is inactive, so there is nothing to update
-            if (!IsActive)
-            {
-                base.Update(gameTime);
-                return;
-            }
-                
-            switch (currentState)
-            {
-                case CatapultState.Idle:
-                    // Nothing to do
-                    break;
-                case CatapultState.Aiming:
-                    if (lastUpdateState != CatapultState.Aiming)
-                    {
-                        AudioManager.PlaySound("ropeStretch", true);
-
-                        AnimationRunning = true;
-                        if (isAI == true)
-                        {
-                            animations["Aim"].PlayFromFrameIndex(0);
-                            stallUpdateCycles = 20;
-                            startStall = false;
-                        }
-                    }
-
-                    // Progress Aiming "animation"
-                    if (isAI == false)
-                    {
-                        UpdateAimAccordingToShotStrength();
-                    }
-                    else
-                    {
-                        animations["Aim"].Update();
-                        startStall = AimReachedShotStrength();
-                        currentState = (startStall) ? 
-                            CatapultState.Stalling : CatapultState.Aiming;
-                    }
-                    break;
-                case CatapultState.Stalling:
-                    if (stallUpdateCycles-- <= 0)
-                    {
-                        // We've finished stalling, fire the projectile
-                        Fire(ShotVelocity);
-                        postUpdateStateChange = CatapultState.Firing;
-                    }
-                    break;
-                case CatapultState.Firing:
-                    // Progress Fire animation
-                    if (lastUpdateState != CatapultState.Firing)
-                    {
-                        AudioManager.StopSound("ropeStretch");
-                        AudioManager.PlaySound("catapultFire");
-                        StartFiringFromLastAimPosition();
-                    }
-
-                    animations["Fire"].Update();
-
-                    // If in the "split" point of the animation start 
-                    // projectile fire sequence
-                    if (animations["Fire"].FrameIndex == splitFrames["Fire"])
-                    {
-                        postUpdateStateChange = 
-                            currentState | CatapultState.ProjectileFlying;
-                        projectile.ProjectilePosition = 
-                            projectile.ProjectileStartPosition;
-                    }
-                    break;
-                case CatapultState.Firing | CatapultState.ProjectileFlying:
-                    // Progress Fire animation                    
-                    animations["Fire"].Update();
-
-                    // Update projectile velocity & position in flight
-                    projectile.UpdateProjectileFlightData(gameTime, wind, 
-                        gravity, out isGroundHit);
-
-                    if (isGroundHit)
-                    {
-                        // Start hit sequence
-                        postUpdateStateChange = CatapultState.ProjectileHit;
-                        animations["fireMiss"].PlayFromFrameIndex(0);
-                    }
-                    break;
-                case CatapultState.ProjectileFlying:
-                    // Update projectile velocity & position in flight
-                    projectile.UpdateProjectileFlightData(gameTime, wind, 
-                        gravity, out isGroundHit);
-                    if (isGroundHit)
-                    {
-                        // Start hit sequence
-                        postUpdateStateChange = CatapultState.ProjectileHit;
-                        animations["fireMiss"].PlayFromFrameIndex(0);
-                    }
-
-                    break;
-                case CatapultState.ProjectileHit:
-                    // Check hit on ground impact
-                    if (!CheckHit())
-                    {
-                        if (lastUpdateState != CatapultState.ProjectileHit)
-                        {
-//                            VibrateController.Default.Start(
-//                                TimeSpan.FromMilliseconds(100));
-                            // Play hit sound only on a missed hit,
-                            // a direct hit will trigger the explosion sound
-                            AudioManager.PlaySound("boulderHit");
-                        }
-
-                        // Hit animation finished playing
-                        if (animations["fireMiss"].IsActive == false)
-                        {
-                            postUpdateStateChange = CatapultState.Reset;
-                        }
-
-                        animations["fireMiss"].Update();
-                    }
-                    else
-                    {
-                        // Catapult hit - start longer vibration on any catapult hit 
-                        // Remember that the call to "CheckHit" updates the catapult's
-                        // state to "Hit"
-//                        VibrateController.Default.Start(
-//                            TimeSpan.FromMilliseconds(500));
-                    }
-
-                    break;
-                case CatapultState.Hit:
-                    // Progress hit animation
-                    if ((animations["Destroyed"].IsActive == false) &&
-                        (animations["hitSmoke"].IsActive == false))
-                    {
-                        if (enemy.Score >= winScore)
-                        {
-                            GameOver = true;
-                            break;
-                        }
-
-                        postUpdateStateChange = CatapultState.Reset;
-                    }
-
-                    animations["Destroyed"].Update();
-                    animations["hitSmoke"].Update();
-
-                    break;
-                case CatapultState.Reset:
-                    AnimationRunning = false;
-                    break;
-                default:
-                    break;
-            }
-
-            lastUpdateState = currentState;
-            if (postUpdateStateChange != 0)
-            {
-                currentState = postUpdateStateChange;
-            }
-
-            base.Update(gameTime);
-        }
-
-        /// <summary>
-        /// Used to check if the current aim animation frame represents the shot
-        /// strength set for the catapult.
-        /// </summary>
-        /// <returns>True if the current frame represents the shot strength,
-        /// false otherwise.</returns>
-        private bool AimReachedShotStrength()
-        {
-            return (animations["Aim"].FrameIndex ==
-                (Convert.ToInt32(animations["Aim"].FrameCount * ShotStrength) - 1));
-        }
-
-        private void UpdateAimAccordingToShotStrength()
-        {
-            var aimAnimation = animations["Aim"];
-            int frameToDisplay =
-                Convert.ToInt32(aimAnimation.FrameCount * ShotStrength);
-            aimAnimation.FrameIndex = Math.Min(aimAnimation.FrameCount, frameToDisplay);
-        }
-
-        /// <summary>
-        /// Calculates the frame from which to start the firing animation, 
-        /// and activates it.
-        /// </summary>
-        private void StartFiringFromLastAimPosition()
-        {
-            int startFrame = animations["Aim"].FrameCount -
-                animations["Aim"].FrameIndex;
-            animations["Fire"].PlayFromFrameIndex(startFrame);
-        }
-
-        public override void Draw(GameTime gameTime)
-        {
-            if (gameTime == null)
-                throw new ArgumentNullException("gameTime");
-
-            // Using the last update state makes sure we do not draw
-            // before updating animations properly
-            switch (lastUpdateState)
-            {
-                case CatapultState.Idle:
-                    DrawIdleCatapult();
-                    break;
-                case CatapultState.Aiming:
-                case CatapultState.Stalling:
-                    animations["Aim"].Draw(spriteBatch, catapultPosition,
-                        spriteEffects);
-                    break;
-                case CatapultState.Firing:
-                    animations["Fire"].Draw(spriteBatch, catapultPosition,
-                        spriteEffects);
-                    break;
-                case CatapultState.Firing | CatapultState.ProjectileFlying:
-                case CatapultState.ProjectileFlying:
-                    animations["Fire"].Draw(spriteBatch, catapultPosition,
-                        spriteEffects);
-
-                    projectile.Draw(gameTime);
-                    break;
-                case CatapultState.ProjectileHit:
-                    // Draw the catapult
-                    DrawIdleCatapult();
-
-                    // Projectile Hit animation
-                    animations["fireMiss"].Draw(spriteBatch,
-                        projectile.ProjectileHitPosition, spriteEffects);
-                    break;
-                case CatapultState.Hit:
-                    // Catapult hit animation
-                    animations["Destroyed"].Draw(spriteBatch, catapultPosition,
-                        spriteEffects);
-
-                    // Projectile smoke animation
-                    animations["hitSmoke"].Draw(spriteBatch, catapultPosition,
-                        spriteEffects);
-                    break;
-                case CatapultState.Reset:
-                    DrawIdleCatapult();
-                    break;
-                default:
-                    break;
-            }
-
-            base.Draw(gameTime);
-        }
-        #endregion
-
-        #region Hit
-        /// <summary>
-        /// Start Hit sequence on catapult - could be executed on self or from enemy in case of hit
-        /// </summary>
-        public void Hit()
-        {
-            AnimationRunning = true;
-            animations["Destroyed"].PlayFromFrameIndex(0);
-            animations["hitSmoke"].PlayFromFrameIndex(0);
-            currentState = CatapultState.Hit;
-        }
-        #endregion
-
-        public void Fire(float velocity)
-        {
-            projectile.Fire(velocity, velocity);
-        }
-
-        #region Helper Functions
-        /// <summary>
-        /// Check if projectile hit some catapult. The possibilities are:
-        /// Nothing hit, Hit enemy, Hit self
-        /// </summary>
-        /// <returns></returns>
-        private bool CheckHit()
-        {
-            bool bRes = false;
-            // Build a sphere around a projectile
-            Vector3 center = new Vector3(projectile.ProjectilePosition, 0);
-            BoundingSphere sphere = new BoundingSphere(center,
-                Math.Max(projectile.ProjectileTexture.Width / 2,
-                projectile.ProjectileTexture.Height / 2));
-
-            // Check Self-Hit - create a bounding box around self
-            Vector3 min = new Vector3(catapultPosition, 0);
-            Vector3 max = new Vector3(catapultPosition +
-                new Vector2(animations["Fire"].FrameSize.X,
-                    animations["Fire"].FrameSize.Y), 0);
-            BoundingBox selfBox = new BoundingBox(min, max);
-
-            // Check enemy - create a bounding box around the enemy
-            min = new Vector3(enemy.Catapult.Position, 0);
-            max = new Vector3(enemy.Catapult.Position +
-                new Vector2(animations["Fire"].FrameSize.X,
-                    animations["Fire"].FrameSize.Y), 0);
-            BoundingBox enemyBox = new BoundingBox(min, max);
-
-            // Check self hit
-            if (sphere.Intersects(selfBox) && currentState != CatapultState.Hit)
-            {
-                AudioManager.PlaySound("catapultExplosion");
-                // Launch hit animation sequence on self
-                Hit();
-                enemy.Score++;
-                bRes = true;
-            }
-            // Check if enemy was hit
-            else if (sphere.Intersects(enemyBox)
-                && enemy.Catapult.CurrentState != CatapultState.Hit
-                && enemy.Catapult.CurrentState != CatapultState.Reset)
-            {
-                AudioManager.PlaySound("catapultExplosion");
-                // Launch enemy hit animaton
-                enemy.Catapult.Hit();
-                self.Score++;
-                bRes = true;
-                currentState = CatapultState.Reset;
-            }
-
-            return bRes;
-        }
-
-        /// <summary>
-        /// Draw catapult in Idle state
-        /// </summary>
-        private void DrawIdleCatapult()
-        {
-            spriteBatch.Draw(idleTexture, catapultPosition, null, Color.White,
-              0.0f, Vector2.Zero, 1.0f,
-              spriteEffects, 0);
-        }
-        #endregion
-
-    }
-}
+//-----------------------------------------------------------------------------
+// Catapult.cs
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// Animation.cs
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input.Touch;
+//using Microsoft.Devices;
+using System.Xml.Linq;
+
+namespace CatapultGame
+{
+    [Flags]
+    public enum CatapultState
+    {
+        Idle = 0x0,
+        Aiming = 0x1,
+        Firing = 0x2,
+        ProjectileFlying = 0x4,
+        ProjectileHit = 0x8,
+        Hit = 0x10,
+        Reset = 0x20,
+        Stalling = 0x40
+    }
+
+    public class Catapult : DrawableGameComponent
+    {
+        // Hold what the game to which the catapult belongs
+        CatapultGame curGame = null;
+
+        SpriteBatch spriteBatch;
+        Random random;
+
+        public bool AnimationRunning { get; set; }
+        public string Name { get; set; }
+        public bool IsActive { get; set; }
+
+        // In some cases the game need to start second animation while first animation is still running;
+        // this variable define at which frame the second animation should start
+        Dictionary<string, int> splitFrames;
+
+        Texture2D idleTexture;
+        Dictionary<string, Animation> animations;
+
+        SpriteEffects spriteEffects;
+
+        // Projectile
+        Projectile projectile;
+
+        string idleTextureName;
+        bool isAI;
+
+        // Game constants
+        const float gravity = 500f;
+
+        // State of the catapult during its last update
+        CatapultState lastUpdateState = CatapultState.Idle;
+
+        // Used to stall animations
+        int stallUpdateCycles;
+
+        // Current state of the Catapult
+        CatapultState currentState;
+        public CatapultState CurrentState
+        {
+            get { return currentState; }
+            set { currentState = value; }
+        }
+
+        float wind;
+        public float Wind
+        {
+            set
+            {
+                wind = value;
+            }
+        }
+
+        Player enemy;
+        internal Player Enemy
+        {
+            set
+            {
+                enemy = value;
+            }
+        }
+
+        Player self;
+        internal Player Self
+        {
+            set
+            {
+                self = value;
+            }
+        }
+
+        Vector2 catapultPosition;
+        public Vector2 Position
+        {
+            get
+            {
+                return catapultPosition;
+            }
+        }
+
+        /// <summary>
+        /// Describes how powerful the current shot being fired is. The more powerful
+        /// the shot, the further it goes. 0 is the weakest, 1 is the strongest.
+        /// </summary>
+        public float ShotStrength { get; set; }
+
+        public float ShotVelocity { get; set; }
+
+        /// <summary>
+        /// Used to determine whether or not the game is over
+        /// </summary>
+        public bool GameOver { get; set; }
+
+        const int winScore = 5;
+
+        public Catapult(Game game)
+            : base(game)
+        {
+            curGame = (CatapultGame)game;
+        }
+
+        public Catapult(Game game, SpriteBatch screenSpriteBatch,
+          string IdleTexture,
+          Vector2 CatapultPosition, SpriteEffects SpriteEffect, bool IsAI)
+            : this(game)
+        {
+            idleTextureName = IdleTexture;
+            catapultPosition = CatapultPosition;
+            spriteEffects = SpriteEffect;
+            spriteBatch = screenSpriteBatch;
+            isAI = IsAI;
+
+            splitFrames = new Dictionary<string, int>();
+            animations = new Dictionary<string, Animation>();
+        }
+
+        /// <summary>
+        /// Function initializes the catapult instance and loads the animations from XML definition sheet
+        /// </summary>
+        public override void Initialize()
+        {
+            // Define initial state of the catapult
+            IsActive = true;
+            AnimationRunning = false;
+            currentState = CatapultState.Idle;
+            stallUpdateCycles = 0;
+			
+			// Load multiple animations form XML definition
+			XDocument doc = null;
+#if ANDROID
+			using(var stream = Game.Activity.Assets.Open(@"Content/Textures/Catapults/AnimationsDef.xml"))
+			{
+				doc = XDocument.Load(stream);
+			}
+#else			
+            doc = XDocument.Load("Content/Textures/Catapults/AnimationsDef.xml");            
+#endif				            
+            XName name = XName.Get("Definition");
+            var definitions = doc.Document.Descendants(name);
+
+            // Loop over all definitions in XML
+            foreach (var animationDefinition in definitions)
+            {
+                bool? toLoad = null;
+                bool val;
+                if (bool.TryParse(animationDefinition.Attribute("IsAI").Value, out val))
+                    toLoad = val;
+
+                // Check if the animation definition need to be loaded for current catapult
+                if (toLoad == isAI || null == toLoad)
+                {
+                    // Get a name of the animation
+                    string animatonAlias = animationDefinition.Attribute("Alias").Value;
+                    Texture2D texture =
+                        curGame.Content.Load<Texture2D>(animationDefinition.Attribute("SheetName").Value);
+
+                    // Get the frame size (width & height)
+                    Point frameSize = new Point();
+                    frameSize.X = int.Parse(animationDefinition.Attribute("FrameWidth").Value);
+                    frameSize.Y = int.Parse(animationDefinition.Attribute("FrameHeight").Value);
+
+                    // Get the frames sheet dimensions
+                    Point sheetSize = new Point();
+                    sheetSize.X = int.Parse(animationDefinition.Attribute("SheetColumns").Value);
+                    sheetSize.Y = int.Parse(animationDefinition.Attribute("SheetRows").Value);
+
+                    // If definition has a "SplitFrame" - means that other animation should start here - load it
+                    if (null != animationDefinition.Attribute("SplitFrame"))
+                        splitFrames.Add(animatonAlias,
+                            int.Parse(animationDefinition.Attribute("SplitFrame").Value));
+
+                    // Defing animation speed
+                    TimeSpan frameInterval = TimeSpan.FromSeconds((float)1 /
+                        int.Parse(animationDefinition.Attribute("Speed").Value));
+
+                    Animation animation = new Animation(texture, frameSize, sheetSize);
+
+                    // If definition has an offset defined - means that it should be rendered relatively
+                    // to some element/other animation - load it
+                    if (null != animationDefinition.Attribute("OffsetX") &&
+                      null != animationDefinition.Attribute("OffsetY"))
+                    {
+                        animation.Offset = new Vector2(int.Parse(animationDefinition.Attribute("OffsetX").Value),
+                            int.Parse(animationDefinition.Attribute("OffsetY").Value));
+                    }
+
+                    animations.Add(animatonAlias, animation);
+                }
+            }
+
+            // Load the textures
+            idleTexture = curGame.Content.Load<Texture2D>(idleTextureName);
+
+            // Initialize the projectile
+            Vector2 projectileStartPosition;
+            if (isAI)
+                projectileStartPosition = new Vector2(630, 340);
+            else
+                projectileStartPosition = new Vector2(175, 340);
+
+            projectile = new Projectile(curGame, spriteBatch, "Textures/Ammo/rock_ammo",
+              projectileStartPosition, animations["Fire"].FrameSize.Y, isAI, gravity);
+            projectile.Initialize();
+
+            // Initialize randomizer
+            random = new Random();
+
+            base.Initialize();
+        }
+
+        public override void Update(GameTime gameTime)
+        {
+            bool isGroundHit;
+            bool startStall;
+            CatapultState postUpdateStateChange = 0;
+
+            if (gameTime == null)
+                throw new ArgumentNullException("gameTime");
+
+            // The catapult is inactive, so there is nothing to update
+            if (!IsActive)
+            {
+                base.Update(gameTime);
+                return;
+            }
+                
+            switch (currentState)
+            {
+                case CatapultState.Idle:
+                    // Nothing to do
+                    break;
+                case CatapultState.Aiming:
+                    if (lastUpdateState != CatapultState.Aiming)
+                    {
+                        AudioManager.PlaySound("ropeStretch", true);
+
+                        AnimationRunning = true;
+                        if (isAI == true)
+                        {
+                            animations["Aim"].PlayFromFrameIndex(0);
+                            stallUpdateCycles = 20;
+                            startStall = false;
+                        }
+                    }
+
+                    // Progress Aiming "animation"
+                    if (isAI == false)
+                    {
+                        UpdateAimAccordingToShotStrength();
+                    }
+                    else
+                    {
+                        animations["Aim"].Update();
+                        startStall = AimReachedShotStrength();
+                        currentState = (startStall) ? 
+                            CatapultState.Stalling : CatapultState.Aiming;
+                    }
+                    break;
+                case CatapultState.Stalling:
+                    if (stallUpdateCycles-- <= 0)
+                    {
+                        // We've finished stalling, fire the projectile
+                        Fire(ShotVelocity);
+                        postUpdateStateChange = CatapultState.Firing;
+                    }
+                    break;
+                case CatapultState.Firing:
+                    // Progress Fire animation
+                    if (lastUpdateState != CatapultState.Firing)
+                    {
+                        AudioManager.StopSound("ropeStretch");
+                        AudioManager.PlaySound("catapultFire");
+                        StartFiringFromLastAimPosition();
+                    }
+
+                    animations["Fire"].Update();
+
+                    // If in the "split" point of the animation start 
+                    // projectile fire sequence
+                    if (animations["Fire"].FrameIndex == splitFrames["Fire"])
+                    {
+                        postUpdateStateChange = 
+                            currentState | CatapultState.ProjectileFlying;
+                        projectile.ProjectilePosition = 
+                            projectile.ProjectileStartPosition;
+                    }
+                    break;
+                case CatapultState.Firing | CatapultState.ProjectileFlying:
+                    // Progress Fire animation                    
+                    animations["Fire"].Update();
+
+                    // Update projectile velocity & position in flight
+                    projectile.UpdateProjectileFlightData(gameTime, wind, 
+                        gravity, out isGroundHit);
+
+                    if (isGroundHit)
+                    {
+                        // Start hit sequence
+                        postUpdateStateChange = CatapultState.ProjectileHit;
+                        animations["fireMiss"].PlayFromFrameIndex(0);
+                    }
+                    break;
+                case CatapultState.ProjectileFlying:
+                    // Update projectile velocity & position in flight
+                    projectile.UpdateProjectileFlightData(gameTime, wind, 
+                        gravity, out isGroundHit);
+                    if (isGroundHit)
+                    {
+                        // Start hit sequence
+                        postUpdateStateChange = CatapultState.ProjectileHit;
+                        animations["fireMiss"].PlayFromFrameIndex(0);
+                    }
+
+                    break;
+                case CatapultState.ProjectileHit:
+                    // Check hit on ground impact
+                    if (!CheckHit())
+                    {
+                        if (lastUpdateState != CatapultState.ProjectileHit)
+                        {
+//                            VibrateController.Default.Start(
+//                                TimeSpan.FromMilliseconds(100));
+                            // Play hit sound only on a missed hit,
+                            // a direct hit will trigger the explosion sound
+                            AudioManager.PlaySound("boulderHit");
+                        }
+
+                        // Hit animation finished playing
+                        if (animations["fireMiss"].IsActive == false)
+                        {
+                            postUpdateStateChange = CatapultState.Reset;
+                        }
+
+                        animations["fireMiss"].Update();
+                    }
+                    else
+                    {
+                        // Catapult hit - start longer vibration on any catapult hit 
+                        // Remember that the call to "CheckHit" updates the catapult's
+                        // state to "Hit"
+//                        VibrateController.Default.Start(
+//                            TimeSpan.FromMilliseconds(500));
+                    }
+
+                    break;
+                case CatapultState.Hit:
+                    // Progress hit animation
+                    if ((animations["Destroyed"].IsActive == false) &&
+                        (animations["hitSmoke"].IsActive == false))
+                    {
+                        if (enemy.Score >= winScore)
+                        {
+                            GameOver = true;
+                            break;
+                        }
+
+                        postUpdateStateChange = CatapultState.Reset;
+                    }
+
+                    animations["Destroyed"].Update();
+                    animations["hitSmoke"].Update();
+
+                    break;
+                case CatapultState.Reset:
+                    AnimationRunning = false;
+                    break;
+                default:
+                    break;
+            }
+
+            lastUpdateState = currentState;
+            if (postUpdateStateChange != 0)
+            {
+                currentState = postUpdateStateChange;
+            }
+
+            base.Update(gameTime);
+        }
+
+        /// <summary>
+        /// Used to check if the current aim animation frame represents the shot
+        /// strength set for the catapult.
+        /// </summary>
+        /// <returns>True if the current frame represents the shot strength,
+        /// false otherwise.</returns>
+        private bool AimReachedShotStrength()
+        {
+            return (animations["Aim"].FrameIndex ==
+                (Convert.ToInt32(animations["Aim"].FrameCount * ShotStrength) - 1));
+        }
+
+        private void UpdateAimAccordingToShotStrength()
+        {
+            var aimAnimation = animations["Aim"];
+            int frameToDisplay =
+                Convert.ToInt32(aimAnimation.FrameCount * ShotStrength);
+            aimAnimation.FrameIndex = Math.Min(aimAnimation.FrameCount, frameToDisplay);
+        }
+
+        /// <summary>
+        /// Calculates the frame from which to start the firing animation, 
+        /// and activates it.
+        /// </summary>
+        private void StartFiringFromLastAimPosition()
+        {
+            int startFrame = animations["Aim"].FrameCount -
+                animations["Aim"].FrameIndex;
+            animations["Fire"].PlayFromFrameIndex(startFrame);
+        }
+
+        public override void Draw(GameTime gameTime)
+        {
+            if (gameTime == null)
+                throw new ArgumentNullException("gameTime");
+
+            // Using the last update state makes sure we do not draw
+            // before updating animations properly
+            switch (lastUpdateState)
+            {
+                case CatapultState.Idle:
+                    DrawIdleCatapult();
+                    break;
+                case CatapultState.Aiming:
+                case CatapultState.Stalling:
+                    animations["Aim"].Draw(spriteBatch, catapultPosition,
+                        spriteEffects);
+                    break;
+                case CatapultState.Firing:
+                    animations["Fire"].Draw(spriteBatch, catapultPosition,
+                        spriteEffects);
+                    break;
+                case CatapultState.Firing | CatapultState.ProjectileFlying:
+                case CatapultState.ProjectileFlying:
+                    animations["Fire"].Draw(spriteBatch, catapultPosition,
+                        spriteEffects);
+
+                    projectile.Draw(gameTime);
+                    break;
+                case CatapultState.ProjectileHit:
+                    // Draw the catapult
+                    DrawIdleCatapult();
+
+                    // Projectile Hit animation
+                    animations["fireMiss"].Draw(spriteBatch,
+                        projectile.ProjectileHitPosition, spriteEffects);
+                    break;
+                case CatapultState.Hit:
+                    // Catapult hit animation
+                    animations["Destroyed"].Draw(spriteBatch, catapultPosition,
+                        spriteEffects);
+
+                    // Projectile smoke animation
+                    animations["hitSmoke"].Draw(spriteBatch, catapultPosition,
+                        spriteEffects);
+                    break;
+                case CatapultState.Reset:
+                    DrawIdleCatapult();
+                    break;
+                default:
+                    break;
+            }
+
+            base.Draw(gameTime);
+        }
+
+        /// <summary>
+        /// Start Hit sequence on catapult - could be executed on self or from enemy in case of hit
+        /// </summary>
+        public void Hit()
+        {
+            AnimationRunning = true;
+            animations["Destroyed"].PlayFromFrameIndex(0);
+            animations["hitSmoke"].PlayFromFrameIndex(0);
+            currentState = CatapultState.Hit;
+        }
+
+        public void Fire(float velocity)
+        {
+            projectile.Fire(velocity, velocity);
+        }
+
+        /// <summary>
+        /// Check if projectile hit some catapult. The possibilities are:
+        /// Nothing hit, Hit enemy, Hit self
+        /// </summary>
+        /// <returns></returns>
+        private bool CheckHit()
+        {
+            bool bRes = false;
+            // Build a sphere around a projectile
+            Vector3 center = new Vector3(projectile.ProjectilePosition, 0);
+            BoundingSphere sphere = new BoundingSphere(center,
+                Math.Max(projectile.ProjectileTexture.Width / 2,
+                projectile.ProjectileTexture.Height / 2));
+
+            // Check Self-Hit - create a bounding box around self
+            Vector3 min = new Vector3(catapultPosition, 0);
+            Vector3 max = new Vector3(catapultPosition +
+                new Vector2(animations["Fire"].FrameSize.X,
+                    animations["Fire"].FrameSize.Y), 0);
+            BoundingBox selfBox = new BoundingBox(min, max);
+
+            // Check enemy - create a bounding box around the enemy
+            min = new Vector3(enemy.Catapult.Position, 0);
+            max = new Vector3(enemy.Catapult.Position +
+                new Vector2(animations["Fire"].FrameSize.X,
+                    animations["Fire"].FrameSize.Y), 0);
+            BoundingBox enemyBox = new BoundingBox(min, max);
+
+            // Check self hit
+            if (sphere.Intersects(selfBox) && currentState != CatapultState.Hit)
+            {
+                AudioManager.PlaySound("catapultExplosion");
+                // Launch hit animation sequence on self
+                Hit();
+                enemy.Score++;
+                bRes = true;
+            }
+            // Check if enemy was hit
+            else if (sphere.Intersects(enemyBox)
+                && enemy.Catapult.CurrentState != CatapultState.Hit
+                && enemy.Catapult.CurrentState != CatapultState.Reset)
+            {
+                AudioManager.PlaySound("catapultExplosion");
+                // Launch enemy hit animaton
+                enemy.Catapult.Hit();
+                self.Score++;
+                bRes = true;
+                currentState = CatapultState.Reset;
+            }
+
+            return bRes;
+        }
+
+        /// <summary>
+        /// Draw catapult in Idle state
+        /// </summary>
+        private void DrawIdleCatapult()
+        {
+            spriteBatch.Draw(idleTexture, catapultPosition, null, Color.White,
+              0.0f, Vector2.Zero, 1.0f,
+              spriteEffects, 0);
+        }
+
+    }
+}

+ 94 - 108
CatapultNetWars/CatapultGame.cs → CatapultNetWars/Core/Catapult/CatapultGame.cs

@@ -1,108 +1,94 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// CatapultGame.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Audio;
-using Microsoft.Xna.Framework.Content;
-using Microsoft.Xna.Framework.GamerServices;
-using Microsoft.Xna.Framework.Graphics;
-using Microsoft.Xna.Framework.Input;
-using Microsoft.Xna.Framework.Input.Touch;
-using Microsoft.Xna.Framework.Media;
-using Microsoft.Xna.Framework.Net;
-using GameStateManagement;
-
-#endregion
-
-namespace CatapultGame
-{
-	/// <summary>
-	/// This is the main type for your game
-	/// </summary>
-	public class CatapultGame : Game
-	{
-        #region Fields
-		GraphicsDeviceManager graphics;
-		ScreenManager screenManager;
-
-		// By preloading any assets used by UI rendering, we avoid framerate glitches
-		// when they suddenly need to be loaded in the middle of a menu transition.
-		static readonly string[] preloadAssets =
-		{
-			"gradient",
-			"cat",
-			"chat_ready",
-			"chat_able",
-			"chat_talking",
-			"chat_mute",
-		};
-
-        #endregion
-
-        #region Initialization Methods
-		public CatapultGame ()
-		{
-			graphics = new GraphicsDeviceManager (this);
-			//graphics.SynchronizeWithVerticalRetrace = false;
-			Content.RootDirectory = "Content";
-
-			// Frame rate is 30 fps by default for Windows Phone.
-			TargetElapsedTime = TimeSpan.FromTicks (333333);
-
-			//Create a new instance of the Screen Manager
-			screenManager = new ScreenManager (this);
-			
-			Components.Add (screenManager);
-
-			Components.Add (new MessageDisplayComponent (this));
-			Components.Add (new GamerServicesComponent (this));
-			
-			//Add two new screens
-			screenManager.AddScreen (new BackgroundScreen (), null);
-			screenManager.AddScreen (new MainMenuScreen (), null);
-
-			// Listen for invite notification events.
-			NetworkSession.InviteAccepted += (sender, e) => NetworkSessionComponent.InviteAccepted (screenManager, e);
-
-			IsMouseVisible = true;
-#if !WINDOWS && !XBOX && !MONOMAC && !LINUX
-			//Switch to full screen for best game experience
-			graphics.IsFullScreen = true;
-#else
-            graphics.PreferredBackBufferHeight = 480;
-            graphics.PreferredBackBufferWidth = 800;
-#endif
-			AudioManager.Initialize (this);
-		}
-
-		/// <summary>
-		/// Allows the game to perform any initialization it needs to before starting to run.
-		/// This is where it can query for any required services and load any non-graphic
-		/// related content.  Calling base.Initialize will enumerate through any components
-		/// and initialize them as well.
-		/// </summary>
-		protected override void Initialize ()
-		{
-			base.Initialize ();
-		}
-        #endregion
-
-        #region Loading
-		protected override void LoadContent ()
-		{
-			AudioManager.LoadSounds ();
-			base.LoadContent ();
-		}
-        #endregion
-	}
-}
+//-----------------------------------------------------------------------------
+// CatapultGame.cs
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Audio;
+using Microsoft.Xna.Framework.Content;
+//using Microsoft.Xna.Framework.GamerServices; // Not available in MonoGame 3.8
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Input;
+using Microsoft.Xna.Framework.Input.Touch;
+using Microsoft.Xna.Framework.Media;
+//using Microsoft.Xna.Framework.Net; // Not available in MonoGame 3.8
+using GameStateManagement;
+
+namespace CatapultGame
+{
+	/// <summary>
+	/// This is the main type for your game
+	/// </summary>
+	public class CatapultGame : Game
+	{
+		GraphicsDeviceManager graphics;
+		ScreenManager screenManager;
+
+		// By preloading any assets used by UI rendering, we avoid framerate glitches
+		// when they suddenly need to be loaded in the middle of a menu transition.
+		static readonly string[] preloadAssets =
+		{
+			"gradient",
+			"cat",
+			"chat_ready",
+			"chat_able",
+			"chat_talking",
+			"chat_mute",
+		};
+
+		public CatapultGame ()
+		{
+			graphics = new GraphicsDeviceManager (this);
+			//graphics.SynchronizeWithVerticalRetrace = false;
+			Content.RootDirectory = "Content";
+
+			// Frame rate is 30 fps by default for Windows Phone.
+			TargetElapsedTime = TimeSpan.FromTicks (333333);
+
+			//Create a new instance of the Screen Manager
+			screenManager = new ScreenManager (this);
+					Components.Add (screenManager);
+			
+			Components.Add (new MessageDisplayComponent (this));
+			// Components.Add (new GamerServicesComponent (this)); // Not available in MonoGame 3.8
+			
+			//Add two new screens
+			screenManager.AddScreen (new BackgroundScreen (), null);
+			screenManager.AddScreen (new MainMenuScreen (), null);
+
+			// Listen for invite notification events.
+			// NetworkSession.InviteAccepted += (sender, e) => NetworkSessionComponent.InviteAccepted (screenManager, e); // Not available in MonoGame 3.8
+
+			IsMouseVisible = true;
+#if ___MOBILE___
+			graphics.IsFullScreen = true;
+#endif
+			graphics.PreferredBackBufferHeight = 480;
+			graphics.PreferredBackBufferWidth = 800;
+
+			AudioManager.Initialize (this);
+		}
+
+		/// <summary>
+		/// Allows the game to perform any initialization it needs to before starting to run.
+		/// This is where it can query for any required services and load any non-graphic
+		/// related content.  Calling base.Initialize will enumerate through any components
+		/// and initialize them as well.
+		/// </summary>
+		protected override void Initialize ()
+		{
+			base.Initialize ();
+		}
+
+		protected override void LoadContent ()
+		{
+			AudioManager.LoadSounds ();
+			base.LoadContent ();
+		}
+	}
+}

+ 177 - 191
CatapultNetWars/Catapult/Projectile.cs → CatapultNetWars/Core/Catapult/Projectile.cs

@@ -1,191 +1,177 @@
-#region File Description
-//-----------------------------------------------------------------------------
-// Projectile.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region File Information
-//-----------------------------------------------------------------------------
-// Projectile.cs
-//
-// Microsoft XNA Community Game Platform
-// Copyright (C) Microsoft Corporation. All rights reserved.
-//-----------------------------------------------------------------------------
-#endregion
-
-#region Using Statements
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-#endregion
-
-namespace CatapultGame
-{
-    class Projectile : DrawableGameComponent
-    {
-        #region Fields/Properties
-        SpriteBatch spriteBatch;
-        Game curGame;
-        Random random;
-
-        // Textures for projectile
-        string textureName;
-        // Position and speed of projectile
-        Vector2 projectileVelocity = Vector2.Zero;
-        float projectileInitialVelocityY;
-        Vector2 projectileRotationPosition = Vector2.Zero;
-        float projectileRotation;
-        float flightTime;
-        bool isAI;
-        float hitOffset;
-        float gravity;
-
-        Vector2 projectileStartPosition;
-        public Vector2 ProjectileStartPosition
-        {
-            get
-            {
-                return projectileStartPosition;
-            }
-            set
-            {
-                projectileStartPosition = value;
-            }
-        }
-
-        Vector2 projectilePosition = Vector2.Zero;
-        public Vector2 ProjectilePosition
-        {
-            get
-            {
-                return projectilePosition;
-            }
-            set
-            {
-                projectilePosition = value;
-            }
-        }
-
-        /// <summary>
-        /// Gets the position where the projectile hit the ground.
-        /// Only valid after a hit occurs.
-        /// </summary>
-        public Vector2 ProjectileHitPosition { get; private set; }
-
-        Texture2D projectileTexture;
-        public Texture2D ProjectileTexture
-        {
-            get
-            {
-                return projectileTexture;
-            }
-            set
-            {
-                projectileTexture = value;
-            }
-        }
-        #endregion
-
-        #region Initialization
-        public Projectile(Game game)
-            : base(game)
-        {
-            curGame = game;
-            random = new Random();
-        }
-
-        public Projectile(Game game, SpriteBatch screenSpriteBatch,
-          string TextureName, Vector2 startPosition, float groundHitOffset,
-          bool isAi, float Gravity)
-            : this(game)
-        {
-            spriteBatch = screenSpriteBatch;
-            projectileStartPosition = startPosition;
-            textureName = TextureName;
-            isAI = isAi;
-            hitOffset = groundHitOffset;
-            gravity = Gravity;
-        }
-
-        public override void Initialize()
-        {
-            // Load a projectile texture
-            projectileTexture = curGame.Content.Load<Texture2D>(textureName);
-        }
-        #endregion
-
-        #region Render
-        public override void Draw(GameTime gameTime)
-        {
-            spriteBatch.Draw(projectileTexture, projectilePosition, null, 
-                Color.White, projectileRotation,
-                new Vector2(projectileTexture.Width / 2,
-                            projectileTexture.Height / 2),
-                1.0f, SpriteEffects.None, 0);
-
-            base.Draw(gameTime);
-        }
-        #endregion
-
-        #region Public functionality
-        /// <summary>
-        /// Helper function - calculates the projectile position and velocity based on time.
-        /// </summary>
-        /// <param name="gameTime">The time since last calculation</param>
-        public void UpdateProjectileFlightData(GameTime gameTime, float wind, float gravity, out bool groundHit)
-        {
-            flightTime += (float)gameTime.ElapsedGameTime.TotalSeconds;
-
-            // Calculate new projectile position using standard
-            // formulas, taking the wind as a force.
-            int direction = isAI ? -1 : 1;
-
-            float previousXPosition = projectilePosition.X;
-            float previousYPosition = projectilePosition.Y;
-
-            projectilePosition.X = projectileStartPosition.X + 
-                (direction * projectileVelocity.X * flightTime) + 
-                0.5f * (8 * wind * (float)Math.Pow(flightTime, 2));
-
-            projectilePosition.Y = projectileStartPosition.Y -
-                (projectileVelocity.Y * flightTime) +
-                0.5f * (gravity * (float)Math.Pow(flightTime, 2));            
-
-            // Calculate the projectile rotation
-            projectileRotation += MathHelper.ToRadians(projectileVelocity.X * 0.5f);
-
-            // Check if projectile hit the ground or even passed it 
-            // (could happen during normal calculation)
-            if (projectilePosition.Y >= 332 + hitOffset)
-            {
-                projectilePosition.X = previousXPosition;
-                projectilePosition.Y = previousYPosition;
-
-                ProjectileHitPosition = new Vector2(previousXPosition, 332);
-
-                groundHit = true;
-            }
-            else
-            {
-                groundHit = false;
-            }
-        }
-
-        public void Fire(float velocityX, float velocityY)
-        {
-            // Set initial projectile velocity
-            projectileVelocity.X = velocityX;
-            projectileVelocity.Y = velocityY;
-            projectileInitialVelocityY = projectileVelocity.Y;
-            // Reset calculation variables
-            flightTime = 0;
-        }
-        #endregion
-    }
-}
+//-----------------------------------------------------------------------------
+// Projectile.cs
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// Projectile.cs
+//
+// Microsoft XNA Community Game Platform
+// Copyright (C) Microsoft Corporation. All rights reserved.
+//-----------------------------------------------------------------------------
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace CatapultGame
+{
+    class Projectile : DrawableGameComponent
+    {
+        SpriteBatch spriteBatch;
+        Game curGame;
+        Random random;
+
+        // Textures for projectile
+        string textureName;
+        // Position and speed of projectile
+        Vector2 projectileVelocity = Vector2.Zero;
+        float projectileInitialVelocityY;
+        Vector2 projectileRotationPosition = Vector2.Zero;
+        float projectileRotation;
+        float flightTime;
+        bool isAI;
+        float hitOffset;
+        float gravity;
+
+        Vector2 projectileStartPosition;
+        public Vector2 ProjectileStartPosition
+        {
+            get
+            {
+                return projectileStartPosition;
+            }
+            set
+            {
+                projectileStartPosition = value;
+            }
+        }
+
+        Vector2 projectilePosition = Vector2.Zero;
+        public Vector2 ProjectilePosition
+        {
+            get
+            {
+                return projectilePosition;
+            }
+            set
+            {
+                projectilePosition = value;
+            }
+        }
+
+        /// <summary>
+        /// Gets the position where the projectile hit the ground.
+        /// Only valid after a hit occurs.
+        /// </summary>
+        public Vector2 ProjectileHitPosition { get; private set; }
+
+        Texture2D projectileTexture;
+        public Texture2D ProjectileTexture
+        {
+            get
+            {
+                return projectileTexture;
+            }
+            set
+            {
+                projectileTexture = value;
+            }
+        }
+
+        public Projectile(Game game)
+            : base(game)
+        {
+            curGame = game;
+            random = new Random();
+        }
+
+        public Projectile(Game game, SpriteBatch screenSpriteBatch,
+          string TextureName, Vector2 startPosition, float groundHitOffset,
+          bool isAi, float Gravity)
+            : this(game)
+        {
+            spriteBatch = screenSpriteBatch;
+            projectileStartPosition = startPosition;
+            textureName = TextureName;
+            isAI = isAi;
+            hitOffset = groundHitOffset;
+            gravity = Gravity;
+        }
+
+        public override void Initialize()
+        {
+            // Load a projectile texture
+            projectileTexture = curGame.Content.Load<Texture2D>(textureName);
+        }
+
+        public override void Draw(GameTime gameTime)
+        {
+            spriteBatch.Draw(projectileTexture, projectilePosition, null, 
+                Color.White, projectileRotation,
+                new Vector2(projectileTexture.Width / 2,
+                            projectileTexture.Height / 2),
+                1.0f, SpriteEffects.None, 0);
+
+            base.Draw(gameTime);
+        }
+
+        /// <summary>
+        /// Helper function - calculates the projectile position and velocity based on time.
+        /// </summary>
+        /// <param name="gameTime">The time since last calculation</param>
+        public void UpdateProjectileFlightData(GameTime gameTime, float wind, float gravity, out bool groundHit)
+        {
+            flightTime += (float)gameTime.ElapsedGameTime.TotalSeconds;
+
+            // Calculate new projectile position using standard
+            // formulas, taking the wind as a force.
+            int direction = isAI ? -1 : 1;
+
+            float previousXPosition = projectilePosition.X;
+            float previousYPosition = projectilePosition.Y;
+
+            projectilePosition.X = projectileStartPosition.X + 
+                (direction * projectileVelocity.X * flightTime) + 
+                0.5f * (8 * wind * (float)Math.Pow(flightTime, 2));
+
+            projectilePosition.Y = projectileStartPosition.Y -
+                (projectileVelocity.Y * flightTime) +
+                0.5f * (gravity * (float)Math.Pow(flightTime, 2));            
+
+            // Calculate the projectile rotation
+            projectileRotation += MathHelper.ToRadians(projectileVelocity.X * 0.5f);
+
+            // Check if projectile hit the ground or even passed it 
+            // (could happen during normal calculation)
+            if (projectilePosition.Y >= 332 + hitOffset)
+            {
+                projectilePosition.X = previousXPosition;
+                projectilePosition.Y = previousYPosition;
+
+                ProjectileHitPosition = new Vector2(previousXPosition, 332);
+
+                groundHit = true;
+            }
+            else
+            {
+                groundHit = false;
+            }
+        }
+
+        public void Fire(float velocityX, float velocityY)
+        {
+            // Set initial projectile velocity
+            projectileVelocity.X = velocityX;
+            projectileVelocity.Y = velocityY;
+            projectileInitialVelocityY = projectileVelocity.Y;
+            // Reset calculation variables
+            flightTime = 0;
+        }
+    }
+}

+ 15 - 0
CatapultNetWars/Core/CatapultNetWars.Core.csproj

@@ -0,0 +1,15 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <TargetFramework>net8.0</TargetFramework>
+    <RootNamespace>CatapultGame</RootNamespace>
+    <AssemblyName>CatapultNetWars.Core</AssemblyName>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="MonoGame.Framework.DesktopGL" Version="3.8.*" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\..\MonoGame.Xna.Framework.Net\MonoGame.Xna.Framework.Net.csproj" />
+  </ItemGroup>
+</Project>

+ 0 - 0
CatapaultWars/Background.png → CatapultNetWars/Core/Content/Background.png


+ 0 - 0
CatapaultWars/Content/Fonts/HUDFont.xnb → CatapultNetWars/Core/Content/Fonts/HUDFont.xnb


+ 0 - 0
CatapaultWars/Content/Fonts/MenuFont.xnb → CatapultNetWars/Core/Content/Fonts/MenuFont.xnb


+ 0 - 0
CatapaultWars/Game.ico → CatapultNetWars/Core/Content/Game.ico


+ 0 - 0
CatapaultWars/Content/Sounds/BoulderHit.wav → CatapultNetWars/Core/Content/Sounds/BoulderHit.wav


+ 0 - 0
CatapaultWars/Content/Sounds/BoulderHit.xnb → CatapultNetWars/Core/Content/Sounds/BoulderHit.xnb


+ 0 - 0
CatapaultWars/Content/Sounds/CatapultExplosion.wav → CatapultNetWars/Core/Content/Sounds/CatapultExplosion.wav


+ 0 - 0
CatapaultWars/Content/Sounds/CatapultExplosion.xnb → CatapultNetWars/Core/Content/Sounds/CatapultExplosion.xnb


+ 0 - 0
CatapaultWars/Content/Sounds/CatapultFire.wav → CatapultNetWars/Core/Content/Sounds/CatapultFire.wav


+ 0 - 0
CatapaultWars/Content/Sounds/CatapultFire.xnb → CatapultNetWars/Core/Content/Sounds/CatapultFire.xnb


+ 0 - 0
CatapaultWars/Content/Sounds/Lose.wav → CatapultNetWars/Core/Content/Sounds/Lose.wav


+ 0 - 0
CatapaultWars/Content/Sounds/Lose.xnb → CatapultNetWars/Core/Content/Sounds/Lose.xnb


+ 0 - 0
CatapaultWars/Content/Sounds/RopeStretch.wav → CatapultNetWars/Core/Content/Sounds/RopeStretch.wav


+ 0 - 0
CatapaultWars/Content/Sounds/RopeStretch.xnb → CatapultNetWars/Core/Content/Sounds/RopeStretch.xnb


+ 0 - 0
CatapaultWars/Content/Sounds/Win.wav → CatapultNetWars/Core/Content/Sounds/Win.wav


+ 0 - 0
CatapaultWars/Content/Sounds/Win.xnb → CatapultNetWars/Core/Content/Sounds/Win.xnb


+ 0 - 0
CatapaultWars/Content/Textures/Ammo/rock_ammo.xnb → CatapultNetWars/Core/Content/Textures/Ammo/rock_ammo.xnb


+ 0 - 0
CatapaultWars/Content/Textures/Backgrounds/blank.xnb → CatapultNetWars/Core/Content/Textures/Backgrounds/blank.xnb


+ 0 - 0
CatapaultWars/Content/Textures/Backgrounds/cloud1.xnb → CatapultNetWars/Core/Content/Textures/Backgrounds/cloud1.xnb


+ 0 - 0
CatapaultWars/Content/Textures/Backgrounds/cloud2.xnb → CatapultNetWars/Core/Content/Textures/Backgrounds/cloud2.xnb


+ 0 - 0
CatapaultWars/Content/Textures/Backgrounds/defeat.xnb → CatapultNetWars/Core/Content/Textures/Backgrounds/defeat.xnb


+ 0 - 0
CatapaultWars/Content/Textures/Backgrounds/gameplay_screen.xnb → CatapultNetWars/Core/Content/Textures/Backgrounds/gameplay_screen.xnb


部分文件因文件數量過多而無法顯示