Browse Source

Ported Catapult Wars game. Compiles, but is not tested.

Dominique Louis 13 years ago
parent
commit
5d16a2057d

+ 12 - 0
Samples/MacOS/CatapaultWars/Screens/InstructionsScreen.cs

@@ -23,6 +23,11 @@ using Microsoft.Xna.Framework.Input.Touch;
 using MonoMac.AppKit;
 using MonoMac.Foundation;
 #endif
+
+#if IOS
+using MonoTouch.UIKit;
+using MonoTouch.Foundation;
+#endif
 #endregion
 
 namespace CatapultGame
@@ -119,10 +124,17 @@ namespace CatapultGame
 
 		void LoadAssetsWorkerThread ()
 		{
+
 			// Create an Autorelease Pool or we will leak objects.
 			using (var pool = new NSAutoreleasePool()) {
 				// Make sure we invoke this on the Main Thread or OpenGL will throw an error
+#if MACOS
 				MonoMac.AppKit.NSApplication.SharedApplication.BeginInvokeOnMainThread (delegate {
+#endif
+#if IOS
+				var invokeOnMainThredObj = new NSObject();
+				invokeOnMainThredObj.InvokeOnMainThread(delegate {
+#endif
 					gameplayScreen.LoadAssets ();
 				});
 			}

+ 15 - 1
Samples/MonoGame.Samples.iOS.sln

@@ -47,6 +47,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Samples.VideoPlaye
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Samples.Primitives", "iOS\MonoGame.Samples.Primitives\MonoGame.Samples.Primitives.csproj", "{C212EEE3-E38E-4F0A-9B98-779694A886DB}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoGame.Samples.CatapultWars", "iOS\Catapults\MonoGame.Samples.CatapultWars.csproj", "{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|iPhoneSimulator = Debug|iPhoneSimulator
@@ -69,6 +71,18 @@ Global
 		{0A404652-27C9-40AA-B037-5665BC725621}.Release|iPhone.Build.0 = Release|iPhone
 		{0A404652-27C9-40AA-B037-5665BC725621}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
 		{0A404652-27C9-40AA-B037-5665BC725621}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Debug|iPhone.ActiveCfg = Debug|iPhone
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Debug|iPhone.Build.0 = Debug|iPhone
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Distribution|iPhone.ActiveCfg = Debug|iPhone
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Distribution|iPhone.Build.0 = Debug|iPhone
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Distribution|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Distribution|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Release|iPhone.ActiveCfg = Release|iPhone
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Release|iPhone.Build.0 = Release|iPhone
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
+		{0FC9E0AB-3FC0-4593-970A-16FA6646CD6C}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
 		{1217FD6D-AFF5-4A21-AA0C-0AE7F14B848F}.Debug|iPhone.ActiveCfg = Debug|iPhone
 		{1217FD6D-AFF5-4A21-AA0C-0AE7F14B848F}.Debug|iPhone.Build.0 = Debug|iPhone
 		{1217FD6D-AFF5-4A21-AA0C-0AE7F14B848F}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
@@ -327,6 +341,6 @@ Global
 		{F5FA28E2-53B2-482B-8723-71588DF50BB6}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
 	EndGlobalSection
 	GlobalSection(MonoDevelopProperties) = preSolution
-		StartupItem = iOS\MonoGame.Samples.Primitives\MonoGame.Samples.Primitives.csproj
+		StartupItem = iOS\Draw2D\MonoGame.Samples.Draw2D.csproj
 	EndGlobalSection
 EndGlobal

+ 13 - 0
Samples/iOS/Catapults/Info.plist

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>UISupportedInterfaceOrientations</key>
+	<array>
+		<string>UIInterfaceOrientationPortrait</string>
+		<string>UIInterfaceOrientationPortraitUpsideDown</string>
+		<string>UIInterfaceOrientationLandscapeLeft</string>
+		<string>UIInterfaceOrientationLandscapeRight</string>
+	</array>
+</dict>
+</plist>

+ 19 - 0
Samples/iOS/Catapults/Main.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MonoTouch.Foundation;
+using MonoTouch.UIKit;
+
+namespace Catapults
+{
+	public class Application
+	{
+		// 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");
+		}
+	}
+}

+ 239 - 0
Samples/iOS/Catapults/MonoGame.Samples.CatapultWars.csproj

@@ -0,0 +1,239 @@
+<?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;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+    <MtouchDebug>true</MtouchDebug>
+    <MtouchProfiling>true</MtouchProfiling>
+    <MtouchLink>None</MtouchLink>
+  </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" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Info.plist" />
+    <None Include="..\..\MacOS\CatapaultWars\Content\Fonts\HUDFont.xnb">
+      <Link>Content\Fonts\HUDFont.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Fonts\MenuFont.xnb">
+      <Link>Content\Fonts\MenuFont.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Sounds\BoulderHit.xnb">
+      <Link>Content\Sounds\BoulderHit.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Sounds\CatapultExplosion.xnb">
+      <Link>Content\Sounds\CatapultExplosion.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Sounds\CatapultFire.xnb">
+      <Link>Content\Sounds\CatapultFire.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Sounds\Lose.xnb">
+      <Link>Content\Sounds\Lose.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Sounds\RopeStretch.xnb">
+      <Link>Content\Sounds\RopeStretch.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Sounds\Win.xnb">
+      <Link>Content\Sounds\Win.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Ammo\rock_ammo.xnb">
+      <Link>Content\Textures\Ammo\rock_ammo.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\blank.xnb">
+      <Link>Content\Textures\Backgrounds\blank.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\cloud1.xnb">
+      <Link>Content\Textures\Backgrounds\cloud1.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\cloud2.xnb">
+      <Link>Content\Textures\Backgrounds\cloud2.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\defeat.xnb">
+      <Link>Content\Textures\Backgrounds\defeat.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\gameplay_screen.xnb">
+      <Link>Content\Textures\Backgrounds\gameplay_screen.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\instructions.xnb">
+      <Link>Content\Textures\Backgrounds\instructions.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\mountain.xnb">
+      <Link>Content\Textures\Backgrounds\mountain.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\sky.xnb">
+      <Link>Content\Textures\Backgrounds\sky.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\title_screen.xnb">
+      <Link>Content\Textures\Backgrounds\title_screen.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Backgrounds\victory.xnb">
+      <Link>Content\Textures\Backgrounds\victory.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\AnimationsDef.xml">
+      <Link>Content\Textures\Catapults\AnimationsDef.xml</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb">
+      <Link>Content\Textures\Catapults\Blue\blueDestroyed\blueCatapult_destroyed.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb">
+      <Link>Content\Textures\Catapults\Blue\blueFire\blueCatapult_fire.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb">
+      <Link>Content\Textures\Catapults\Blue\blueIdle\blueIdle.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb">
+      <Link>Content\Textures\Catapults\Blue\bluePullback\blueCatapult_Pullback.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\Fire_Miss\fire_miss.xnb">
+      <Link>Content\Textures\Catapults\Fire_Miss\fire_miss.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\Hit_Smoke\smoke.xnb">
+      <Link>Content\Textures\Catapults\Hit_Smoke\smoke.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb">
+      <Link>Content\Textures\Catapults\Red\redDestroyed\redCatapult_destroyed.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb">
+      <Link>Content\Textures\Catapults\Red\redFire\redCatapult_fire.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\Red\redIdle\redIdle.xnb">
+      <Link>Content\Textures\Catapults\Red\redIdle\redIdle.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb">
+      <Link>Content\Textures\Catapults\Red\redPullback\redCatapult_Pullback.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\HUD\Arrow.xnb">
+      <Link>Content\Textures\HUD\Arrow.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\HUD\ammoType.xnb">
+      <Link>Content\Textures\HUD\ammoType.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\HUD\hudBackground.xnb">
+      <Link>Content\Textures\HUD\hudBackground.xnb</Link>
+    </None>
+    <None Include="..\..\MacOS\CatapaultWars\Content\Textures\HUD\windArrow.xnb">
+      <Link>Content\Textures\HUD\windArrow.xnb</Link>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Main.cs" />
+    <Compile Include="..\..\MacOS\CatapaultWars\CatapultGame.cs">
+      <Link>CatapultGame.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Catapult\Catapult.cs">
+      <Link>Catapult\Catapult.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Catapult\Projectile.cs">
+      <Link>Catapult\Projectile.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Players\AI.cs">
+      <Link>Players\AI.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Players\Human.cs">
+      <Link>Players\Human.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Players\Player.cs">
+      <Link>Players\Player.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\ScreenManager\GameScreen.cs">
+      <Link>ScreenManager\GameScreen.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\ScreenManager\InputState.cs">
+      <Link>ScreenManager\InputState.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\ScreenManager\MenuEntry.cs">
+      <Link>ScreenManager\MenuEntry.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\ScreenManager\MenuScreen.cs">
+      <Link>ScreenManager\MenuScreen.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\ScreenManager\MouseGestureType.cs">
+      <Link>ScreenManager\MouseGestureType.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\ScreenManager\PlayerIndexEventArgs.cs">
+      <Link>ScreenManager\PlayerIndexEventArgs.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\ScreenManager\ScreenManager.cs">
+      <Link>ScreenManager\ScreenManager.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Screens\BackgroundScreen.cs">
+      <Link>Screens\BackgroundScreen.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Screens\GameplayScreen.cs">
+      <Link>Screens\GameplayScreen.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Screens\InstructionsScreen.cs">
+      <Link>Screens\InstructionsScreen.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Screens\MainMenuScreen.cs">
+      <Link>Screens\MainMenuScreen.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Screens\PauseScreen.cs">
+      <Link>Screens\PauseScreen.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Utility\Animation.cs">
+      <Link>Utility\Animation.cs</Link>
+    </Compile>
+    <Compile Include="..\..\MacOS\CatapaultWars\Utility\AudioManager.cs">
+      <Link>Utility\AudioManager.cs</Link>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <ItemGroup>
+    <Content Include="..\..\MacOS\CatapaultWars\Background.png">
+      <Link>Background.png</Link>
+    </Content>
+  </ItemGroup>
+</Project>