Browse Source

Android sample updated to 3.8.1 for NeonShooter

Simon Jackson 3 years ago
parent
commit
42bf82e40e

+ 11 - 17
NeonShooter/NeonShooter.Android.sln

@@ -1,11 +1,9 @@
-
+
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30406.217
+# Visual Studio Version 17
+VisualStudioVersion = 17.4.32912.340
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeonShooter.Android", "NeonShooter.Android\NeonShooter.Android.csproj", "{B88A3D22-39D5-4AA3-B9E9-1D6588E1E397}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NeonShooter.Core", "NeonShooter.Core\NeonShooter.Core.csproj", "{4E2DA2EA-529F-4DB8-B0AB-56E148D2A4E4}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeonShooter.Android", "NeonShooter.Android/NeonShooter.Android.csproj", "{4BAD05A6-F082-4DB2-8A64-42197167DB34}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -13,21 +11,17 @@ Global
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{B88A3D22-39D5-4AA3-B9E9-1D6588E1E397}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{B88A3D22-39D5-4AA3-B9E9-1D6588E1E397}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{B88A3D22-39D5-4AA3-B9E9-1D6588E1E397}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
-		{B88A3D22-39D5-4AA3-B9E9-1D6588E1E397}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{B88A3D22-39D5-4AA3-B9E9-1D6588E1E397}.Release|Any CPU.Build.0 = Release|Any CPU
-		{B88A3D22-39D5-4AA3-B9E9-1D6588E1E397}.Release|Any CPU.Deploy.0 = Release|Any CPU
-		{4E2DA2EA-529F-4DB8-B0AB-56E148D2A4E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{4E2DA2EA-529F-4DB8-B0AB-56E148D2A4E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{4E2DA2EA-529F-4DB8-B0AB-56E148D2A4E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{4E2DA2EA-529F-4DB8-B0AB-56E148D2A4E4}.Release|Any CPU.Build.0 = Release|Any CPU
+		{4BAD05A6-F082-4DB2-8A64-42197167DB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{4BAD05A6-F082-4DB2-8A64-42197167DB34}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{4BAD05A6-F082-4DB2-8A64-42197167DB34}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+		{4BAD05A6-F082-4DB2-8A64-42197167DB34}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{4BAD05A6-F082-4DB2-8A64-42197167DB34}.Release|Any CPU.Build.0 = Release|Any CPU
+		{4BAD05A6-F082-4DB2-8A64-42197167DB34}.Release|Any CPU.Deploy.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
-		SolutionGuid = {88F5D19A-F9BD-4705-B391-4D710B6C1BC4}
+		SolutionGuid = {113E6F7B-15F3-4C0E-BD17-35BC11EAEEA8}
 	EndGlobalSection
 EndGlobal

+ 36 - 0
NeonShooter/NeonShooter.Android/.config/dotnet-tools.json

@@ -0,0 +1,36 @@
+{
+  "version": 1,
+  "isRoot": true,
+  "tools": {
+    "dotnet-mgcb": {
+      "version": "3.8.1.303",
+      "commands": [
+        "mgcb"
+      ]
+    },
+    "dotnet-mgcb-editor": {
+      "version": "3.8.1.303",
+      "commands": [
+        "mgcb-editor"
+      ]
+    },
+    "dotnet-mgcb-editor-linux": {
+      "version": "3.8.1.303",
+      "commands": [
+        "mgcb-editor-linux"
+      ]
+    },
+    "dotnet-mgcb-editor-windows": {
+      "version": "3.8.1.303",
+      "commands": [
+        "mgcb-editor-windows"
+      ]
+    },
+    "dotnet-mgcb-editor-mac": {
+      "version": "3.8.1.303",
+      "commands": [
+        "mgcb-editor-mac"
+      ]
+    }
+  }
+}

+ 6 - 0
NeonShooter/NeonShooter.Android/AndroidManifest.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="NeonShooter.Android.NeonShooter.Android" android:versionCode="1" android:versionName="1.0">
+  <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="31" />
+  <uses-feature android:glEsVersion="0x00020000" android:required="true" />
+  <application android:label="NeonShooter.Android"></application>
+</manifest>

+ 0 - 19
NeonShooter/NeonShooter.Android/Assets/AboutAssets.txt

@@ -1,19 +0,0 @@
-Any raw assets you want to be deployed with your application can be placed in
-this directory (and child directories) and given a Build Action of "AndroidAsset".
-
-These files will be deployed with you package and will be accessible using Android's
-AssetManager, like this:
-
-public class ReadAsset : Activity
-{
-	protected override void OnCreate (Bundle bundle)
-	{
-		base.OnCreate (bundle);
-
-		InputStream input = Assets.Open ("my_asset.txt");
-	}
-}
-
-Additionally, some Android functions will automatically load asset files:
-
-Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");

+ 45 - 86
NeonShooter/NeonShooter.Android/NeonShooter.Android.csproj

@@ -1,89 +1,48 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>8.0.30703</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{B88A3D22-39D5-4AA3-B9E9-1D6588E1E397}</ProjectGuid>
-    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Library</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>NeonShooter.Android</RootNamespace>
-    <AssemblyName>NeonShooter.Android</AssemblyName>
-    <FileAlignment>512</FileAlignment>
-    <AndroidApplication>true</AndroidApplication>
-    <AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
-    <AndroidResgenClass>Resource</AndroidResgenClass>
-    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
-    <AndroidStoreUncompressedFileExtensions>.m4a</AndroidStoreUncompressedFileExtensions>
-    <TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
-    <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
-    <AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
-    <MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
-    <MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
-    <AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
-    <AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
+    <TargetFramework>net6.0-android</TargetFramework>
+    <SupportedOSPlatformVersion>23</SupportedOSPlatformVersion>
+    <OutputType>Exe</OutputType>
+    <ApplicationId>com.companyname.NeonShooter.Android</ApplicationId>
+    <ApplicationVersion>1</ApplicationVersion>
+    <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
   </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
-    <DefineConstants>DEBUG;TRACE;ANDROID</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
-    <AndroidLinkMode>None</AndroidLinkMode>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
-    <DefineConstants>TRACE;ANDROID</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
-    <AndroidLinkMode>SdkOnly</AndroidLinkMode>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml" />
-    <Reference Include="Mono.Android" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Activity1.cs" />
-    <Compile Include="Resources\Resource.Designer.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <AndroidResource Include="Resources\Drawable\Icon.png" />
-    <AndroidResource Include="Resources\Values\Strings.xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <MonoGameContentReference Include="..\NeonShooter.Core\Content\NeonShooter.mgcb">
-      <Link>Content\NeonShooter.mgcb</Link>
-    </MonoGameContentReference>
-  </ItemGroup>
   <ItemGroup>
-    <None Include="Properties\AndroidManifest.xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.0.1641" />
-    <PackageReference Include="MonoGame.Framework.Android" Version="3.8.0.1641" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\NeonShooter.Core\NeonShooter.Core.csproj">
-      <Project>{4e2da2ea-529f-4db8-b0ab-56e148d2a4e4}</Project>
-      <Name>NeonShooter.Core</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
-    <AndroidResource Include="Resources\Drawable\Splash.png" />
-  </ItemGroup>
-  <ItemGroup>
-    <AndroidResource Include="Resources\Values\Styles.xml" />
-  </ItemGroup>
-  <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
-</Project>
+    <Compile Include="..\NeonShooter.Core\Game\Art.cs" Link="Game\Art.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\BlackHole.cs" Link="Game\BlackHole.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\BloomComponent.cs" Link="Game\BloomComponent.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\BloomSettings.cs" Link="Game\BloomSettings.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\Bullet.cs" Link="Game\Bullet.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\ColorUtil.cs" Link="Game\ColorUtil.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\Enemy.cs" Link="Game\Enemy.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\EnemySpawner.cs" Link="Game\EnemySpawner.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\Entity.cs" Link="Game\Entity.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\EntityManager.cs" Link="Game\EntityManager.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\Extensions.cs" Link="Game\Extensions.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\GameRoot.cs" Link="Game\GameRoot.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\Grid.cs" Link="Game\Grid.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\Input.cs" Link="Game\Input.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\MathUtil.cs" Link="Game\MathUtil.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\ParticleManager.cs" Link="Game\ParticleManager.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\ParticleState.cs" Link="Game\ParticleState.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\PlayerShip.cs" Link="Game\PlayerShip.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\PlayerStatus.cs" Link="Game\PlayerStatus.cs" />
+    <Compile Include="..\NeonShooter.Core\Game\Sound.cs" Link="Game\Sound.cs" />
+    <Compile Include="..\NeonShooter.Core\NeonShooterGame.cs" Link="NeonShooterGame.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="MonoGame.Content.Builder.Task" Version="3.8.1.303" />
+    <PackageReference Include="MonoGame.Framework.Android" Version="3.8.1.303" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Content\" />
+    <Folder Include="Game\" />
+  </ItemGroup>
+  <ItemGroup>
+    <MonoGameContentReference Include="..\NeonShooter.Core\Content\NeonShooter.mgcb" Link="Content\NeonShooter.mgcb" />
+  </ItemGroup>
+  <Target Name="RestoreDotnetTools" BeforeTargets="Restore">
+    <Message Text="Restoring dotnet tools" Importance="High" />
+    <Exec Command="dotnet tool restore" />
+  </Target>
+</Project>

+ 0 - 7
NeonShooter/NeonShooter.Android/NeonShooter.Android.csproj.user

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <SelectedDevice>pixel_2_pie_9_0_-_api_28</SelectedDevice>
-    <DefaultDevice>pixel_2_pie_9_0_-_api_28</DefaultDevice>
-  </PropertyGroup>
-</Project>

+ 0 - 5
NeonShooter/NeonShooter.Android/Properties/AndroidManifest.xml

@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="NeonShooter.Android.NeonShooter.Android" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
-	<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
-	<application android:label="NeonShooter.Android" android:icon="@drawable/Icon"></application>
-</manifest>

+ 0 - 30
NeonShooter/NeonShooter.Android/Properties/AssemblyInfo.cs

@@ -1,30 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using Android.App;
-
-// General Information about an assembly is controlled through the following 
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("NeonShooter.Android")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("NeonShooter.Android")]
-[assembly: AssemblyCopyright("Copyright ©  2018")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
-
-// Version information for an assembly consists of the following four values:
-//
-//      Major Version
-//      Minor Version 
-//      Build Number
-//      Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers 
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]

+ 0 - 44
NeonShooter/NeonShooter.Android/Resources/AboutResources.txt

@@ -1,44 +0,0 @@
-Images, layout descriptions, binary blobs and string dictionaries can be included 
-in your application as resource files.  Various Android APIs are designed to 
-operate on the resource IDs instead of dealing with images, strings or binary blobs 
-directly.
-
-For example, a sample Android app that contains a user interface layout (Main.xml),
-an internationalization string table (Strings.xml) and some icons (drawable/Icon.png) 
-would keep its resources in the "Resources" directory of the application:
-
-Resources/
-    Drawable/
-        Icon.png
-
-    Layout/
-        Main.axml
-
-    Values/
-        Strings.xml
-
-In order to get the build system to recognize Android resources, the build action should be set 
-to "AndroidResource".  The native Android APIs do not operate directly with filenames, but 
-instead operate on resource IDs.  When you compile an Android application that uses resources, 
-the build system will package the resources for distribution and generate a class called
-"Resource" that contains the tokens for each one of the resources included. For example, 
-for the above Resources layout, this is what the Resource class would expose:
-
-public class Resource {
-    public class Drawable {
-        public const int Icon = 0x123;
-    }
-
-    public class Layout {
-        public const int Main = 0x456;
-    }
-
-    public class String {
-        public const int FirstString = 0xabc;
-        public const int SecondString = 0xbcd;
-    }
-}
-
-You would then use Resource.Drawable.Icon to reference the Drawable/Icon.png file, or 
-Resource.Layout.Main to reference the Layout/Main.axml file, or Resource.String.FirstString
-to reference the first string in the dictionary file Values/Strings.xml.

BIN
NeonShooter/NeonShooter.Android/Resources/Drawable/Icon.png


+ 0 - 98
NeonShooter/NeonShooter.Android/Resources/Resource.Designer.cs

@@ -1,98 +0,0 @@
-#pragma warning disable 1591
-//------------------------------------------------------------------------------
-// <auto-generated>
-//     This code was generated by a tool.
-//
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-[assembly: global::Android.Runtime.ResourceDesignerAttribute("NeonShooter.Android.Resource", IsApplication=true)]
-
-namespace NeonShooter.Android
-{
-	
-	
-	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
-	public partial class Resource
-	{
-		
-		static Resource()
-		{
-			global::Android.Runtime.ResourceIdManager.UpdateIdValues();
-		}
-		
-		public static void UpdateIdValues()
-		{
-		}
-		
-		public partial class Attribute
-		{
-			
-			static Attribute()
-			{
-				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
-			}
-			
-			private Attribute()
-			{
-			}
-		}
-		
-		public partial class Drawable
-		{
-			
-			// aapt resource value: 0x7F010000
-			public const int Icon = 2130771968;
-			
-			// aapt resource value: 0x7F010001
-			public const int Splash = 2130771969;
-			
-			static Drawable()
-			{
-				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
-			}
-			
-			private Drawable()
-			{
-			}
-		}
-		
-		public partial class String
-		{
-			
-			// aapt resource value: 0x7F020000
-			public const int ApplicationName = 2130837504;
-			
-			// aapt resource value: 0x7F020001
-			public const int Hello = 2130837505;
-			
-			static String()
-			{
-				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
-			}
-			
-			private String()
-			{
-			}
-		}
-		
-		public partial class Style
-		{
-			
-			// aapt resource value: 0x7F030000
-			public const int Theme_Splash = 2130903040;
-			
-			static Style()
-			{
-				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
-			}
-			
-			private Style()
-			{
-			}
-		}
-	}
-}
-#pragma warning restore 1591

+ 1 - 2
NeonShooter/NeonShooter.Android/Resources/Values/Strings.xml

@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-    <string name="Hello">Hello World, Click Me!</string>
-    <string name="ApplicationName">NeonShooter</string>
+  <string name="app_name">NeonShooter</string>
 </resources>