Browse Source

Updates for AtomicNET

Josh Engebretson 9 years ago
parent
commit
7857eb85f9
48 changed files with 600 additions and 234 deletions
  1. 1 1
      AtomicNET/AtomicBlaster/.gitignore
  2. 64 0
      AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/MainActivity.cs
  3. 5 0
      AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/Properties/AndroidManifest.xml
  4. 30 0
      AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/Properties/AssemblyInfo.cs
  5. 80 0
      AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/Resources/Resource.Designer.cs
  6. BIN
      AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/Resources/drawable/icon.png
  7. 4 0
      AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/Resources/values/Strings.xml
  8. 18 0
      AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Desktop/Program.cs
  9. 46 20
      AtomicNET/AtomicBlaster/Resources/Scripts/Art.cs
  10. 9 7
      AtomicNET/AtomicBlaster/Resources/Scripts/CustomRenderer.cs
  11. 1 1
      AtomicNET/AtomicBlaster/Resources/Scripts/Enemy.cs
  12. 2 1
      AtomicNET/AtomicBlaster/Resources/Scripts/Entity.cs
  13. 2 0
      AtomicNET/AtomicBlaster/Resources/Scripts/EntityManager.cs
  14. 7 2
      AtomicNET/AtomicBlaster/Resources/Scripts/GameRoot.cs
  15. 3 3
      AtomicNET/AtomicBlaster/Resources/Scripts/ParticleManager.cs
  16. 0 20
      AtomicNET/AtomicBlaster/Resources/Scripts/Program.cs
  17. 0 5
      AtomicNET/AtomicBlaster/Resources/Scripts/Program.cs.asset
  18. 52 0
      AtomicNET/AtomicBlaster/Resources/Scripts/ShipInput.cs
  19. 0 0
      AtomicNET/AtomicBlaster/Resources/Scripts/Sprites.cs
  20. 5 0
      AtomicNET/AtomicBlaster/Resources/Scripts/Sprites.cs.asset
  21. 0 157
      AtomicNET/AtomicBlaster/Resources/Sprites/AtomicBlasterSprites.plist
  22. BIN
      AtomicNET/AtomicBlaster/Resources/Sprites/AtomicBlasterSprites.png
  23. 3 1
      AtomicNET/AtomicBlaster/Resources/Sprites/AtomicBlasterSprites.png.asset
  24. 14 0
      AtomicNET/AtomicBlaster/Resources/Sprites/AtomicBlasterSprites.xml
  25. 5 0
      AtomicNET/AtomicBlaster/Resources/Sprites/AtomicBlasterSprites.xml.asset
  26. 3 1
      AtomicNET/AtomicBlaster/Resources/Sprites/BlackHole.png.asset
  27. 3 1
      AtomicNET/AtomicBlaster/Resources/Sprites/Bullet.png.asset
  28. 3 1
      AtomicNET/AtomicBlaster/Resources/Sprites/Glow.png.asset
  29. 3 1
      AtomicNET/AtomicBlaster/Resources/Sprites/Laser.png.asset
  30. 3 1
      AtomicNET/AtomicBlaster/Resources/Sprites/Pixel.png.asset
  31. 3 1
      AtomicNET/AtomicBlaster/Resources/Sprites/Player.png.asset
  32. 3 1
      AtomicNET/AtomicBlaster/Resources/Sprites/Pointer.png.asset
  33. 3 1
      AtomicNET/AtomicBlaster/Resources/Sprites/Seeker.png.asset
  34. 3 1
      AtomicNET/AtomicBlaster/Resources/Sprites/Wanderer.png.asset
  35. 4 0
      AtomicNET/AtomicBlaster/Settings/Project.json
  36. 1 1
      AtomicNET/Butterflies/.gitignore
  37. 64 0
      AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/MainActivity.cs
  38. 5 0
      AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/Properties/AndroidManifest.xml
  39. 30 0
      AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/Properties/AssemblyInfo.cs
  40. 80 0
      AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/Resources/Resource.Designer.cs
  41. BIN
      AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/Resources/drawable/icon.png
  42. 4 0
      AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/Resources/values/Strings.xml
  43. 17 0
      AtomicNET/Butterflies/Project/AtomicNET/Platforms/Desktop/Program.cs
  44. 0 5
      AtomicNET/Butterflies/Resources.asset
  45. 1 1
      AtomicNET/Butterflies/Resources/Scenes/TheScene.scene
  46. 7 0
      AtomicNET/Butterflies/Resources/Scripts/AtomicMain.cs
  47. 5 0
      AtomicNET/Butterflies/Resources/Scripts/AtomicMain.cs.asset
  48. 4 0
      AtomicNET/Butterflies/Settings/Project.json

+ 1 - 1
AtomicNET/AtomicBlaster/.gitignore

@@ -2,4 +2,4 @@ UserPrefs.json
 BuildSettings.json
 Cache/*
 AtomicNET/*
-Resources/AtomicProject.*
+Resources/AtomicBlaster.*

+ 64 - 0
AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/MainActivity.cs

@@ -0,0 +1,64 @@
+using Android.App;
+using Android.Content.PM;
+using Android.Widget;
+using Android.OS;
+using Android.Views;
+using AtomicEngine;
+
+using AtomicBlaster;
+
+namespace AtomicPlayer
+{
+	[Activity(Label = "AtomicPlayer", MainLauncher = true,
+		Icon = "@drawable/icon", Theme = "@android:style/Theme.NoTitleBar.Fullscreen",
+		ConfigurationChanges = ConfigChanges.KeyboardHidden | ConfigChanges.Orientation,
+		ScreenOrientation = ScreenOrientation.Landscape)]
+	public class MainActivity : Activity
+	{
+		protected override void OnCreate(Bundle bundle)
+		{
+			base.OnCreate(bundle);
+			var mLayout = new AbsoluteLayout(this);
+            var surface = AndroidSDLSurface.CreateSurface(this, false, typeof(GameRoot));
+			mLayout.AddView(surface);
+			SetContentView(mLayout);
+		}
+
+		protected override void OnResume()
+		{
+            AndroidSDLSurface.OnResume();
+			base.OnResume();
+		}
+
+		protected override void OnPause()
+		{
+            AndroidSDLSurface.OnPause();
+			base.OnPause();
+		}
+
+		public override void OnLowMemory()
+		{
+            AndroidSDLSurface.OnLowMemory();
+			base.OnLowMemory();
+		}
+
+		protected override void OnDestroy()
+		{
+            AndroidSDLSurface.OnDestroy();
+			base.OnDestroy();
+		}
+
+		public override bool DispatchKeyEvent(KeyEvent e)
+		{
+			if (!AndroidSDLSurface.DispatchKeyEvent(e))
+				return false;
+			return base.DispatchKeyEvent(e);
+		}
+
+		public override void OnWindowFocusChanged(bool hasFocus)
+		{
+            AndroidSDLSurface.OnWindowFocusChanged(hasFocus);
+			base.OnWindowFocusChanged(hasFocus);
+		}
+	}
+}

+ 5 - 0
AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/Properties/AndroidManifest.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="AtomicBlaster.AtomicBlaster" android:versionCode="1" android:versionName="1.0">
+	<uses-sdk android:minSdkVersion="16" />
+	<application android:label="AtomicBlaster"></application>
+</manifest>

+ 30 - 0
AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/Properties/AssemblyInfo.cs

@@ -0,0 +1,30 @@
+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("AtomicBlaster")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("AtomicBlaster")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[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")]

+ 80 - 0
AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/Resources/Resource.Designer.cs

@@ -0,0 +1,80 @@
+#pragma warning disable 1591
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+[assembly: global::Android.Runtime.ResourceDesignerAttribute("Application.Resource", IsApplication=true)]
+
+namespace Application
+{
+	
+	
+	[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: 0x7f020000
+			public const int icon = 2130837504;
+			
+			static Drawable()
+			{
+				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
+			}
+			
+			private Drawable()
+			{
+			}
+		}
+		
+		public partial class String
+		{
+			
+			// aapt resource value: 0x7f030001
+			public const int ApplicationName = 2130903041;
+			
+			// aapt resource value: 0x7f030000
+			public const int app_name = 2130903040;
+			
+			static String()
+			{
+				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
+			}
+			
+			private String()
+			{
+			}
+		}
+	}
+}
+#pragma warning restore 1591

BIN
AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/Resources/drawable/icon.png


+ 4 - 0
AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Android/Resources/values/Strings.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="ApplicationName">AtomicBlaster</string>
+</resources>

+ 18 - 0
AtomicNET/AtomicBlaster/Project/AtomicNET/Platforms/Desktop/Program.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Linq;
+
+using AtomicEngine;
+using AtomicBlaster;
+
+namespace AtomicPlayer
+{
+    public class Program
+    {        
+        public static void Main(string[] args)
+        {
+            Application.Run<GameRoot>(args);
+        }
+    }
+}

+ 46 - 20
AtomicNET/AtomicBlaster/Resources/Scripts/Art.cs

@@ -8,35 +8,61 @@ using AtomicEngine;
 
 namespace AtomicBlaster
 {
-    static class Art
+    public class CustomSprite
     {
-        public static Texture2D Player { get; private set; }
-        public static Texture2D Seeker { get; private set; }
-        public static Texture2D Wanderer { get; private set; }
-        public static Texture2D Bullet { get; private set; }
-        public static Texture2D Pointer { get; private set; }
-        public static Texture2D BlackHole { get; private set; }
+        public CustomSprite(Sprite2D sprite)
+        {
+            var rect = new Rect();
+
+            sprite.GetTextureRectangle(ref rect);
+
+            TexCoordTL = rect.Min;
+            TexCoordBR = rect.Max;
+
+            Height = (int) (rect.Height * 128);
+            Width = (int) (rect.Width * 128);
+
+            Texture = sprite.Texture;
+        }
 
-        public static Texture2D LineParticle { get; private set; }
-        public static Texture2D Glow { get; private set; }
-        public static Texture2D Pixel { get; private set; }     // a single white pixel
+        public int Height;
+        public int Width;
 
+        public Vector2 TexCoordTL;
+        public Vector2 TexCoordBR;
+        public Texture2D Texture;
+
+    }
+
+    static class Art
+    {
+        public static CustomSprite Player { get; private set; }
+        public static CustomSprite Seeker { get; private set; }
+        public static CustomSprite Wanderer { get; private set; }
+        public static CustomSprite Bullet { get; private set; }
+        public static CustomSprite Pointer { get; private set; }
+        public static CustomSprite BlackHole { get; private set; }
+
+        public static CustomSprite LineParticle { get; private set; }
+        public static CustomSprite Glow { get; private set; }
+        public static CustomSprite Pixel { get; private set; }     // a single white pixel
 
         public static void Load()
         {
             var cache = AtomicNET.Cache;
 
-            Player = cache.GetResource<Texture2D>("Sprites/Player.png");
-            Seeker = cache.GetResource<Texture2D>("Sprites/Seeker.png");
-            Wanderer = cache.GetResource<Texture2D>("Sprites/Wanderer.png");
-            Bullet = cache.GetResource<Texture2D>("Sprites/Bullet.png");
-            Pointer = cache.GetResource<Texture2D>("Sprites/Pointer.png");
-            BlackHole = cache.GetResource<Texture2D>("Sprites/BlackHole.png");
-
-            LineParticle = cache.GetResource<Texture2D>("Sprites/Laser.png");
-            Glow = cache.GetResource<Texture2D>("Sprites/Glow.png");
-            Pixel = cache.GetResource<Texture2D>("Sprites/Pixel.png");
+            SpriteSheet2D sheet = cache.GetResource<SpriteSheet2D>("Sprites/AtomicBlasterSprites.xml");
 
+            Player = new CustomSprite(sheet.GetSprite("Player"));
+            Seeker = new CustomSprite(sheet.GetSprite("Seeker"));
+            Wanderer = new CustomSprite(sheet.GetSprite("Wanderer"));
+            Bullet = new CustomSprite(sheet.GetSprite("Bullet"));
+            Pointer = new CustomSprite(sheet.GetSprite("Pointer"));
+            BlackHole = new CustomSprite(sheet.GetSprite("BlackHole"));
+            
+            LineParticle = new CustomSprite(sheet.GetSprite("Laser"));
+            Glow = new CustomSprite(sheet.GetSprite("Glow"));
+            Pixel = new CustomSprite(sheet.GetSprite("Pixel"));
         }
     }
 }

+ 9 - 7
AtomicNET/AtomicBlaster/Resources/Scripts/CustomRenderer.cs

@@ -161,7 +161,7 @@ namespace AtomicBlaster
 
         }
 
-        public static void Draw(Texture2D texture, Vector2 position, Color color, float rotation, Vector2 origin, float scale, float layerDepth)
+        public static void Draw(CustomSprite texture, Vector2 position, Color color, float rotation, Vector2 origin, float scale, float layerDepth)
         {
 
             var w = texture.Width * scale;
@@ -175,7 +175,7 @@ namespace AtomicBlaster
                 layerDepth);
         }
 
-        public static void Draw(Texture2D texture, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, float layerDepth)
+        public static void Draw(CustomSprite texture, Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale, float layerDepth)
         {
 
             var w = texture.Width * scale.X;
@@ -196,7 +196,7 @@ namespace AtomicBlaster
         }
 
 
-        static void DrawInternal(Texture2D texture, Vector4 destinationRectangle, Color color, float rotation, Vector2 origin, float depth)
+        static void DrawInternal(CustomSprite sprite, Vector4 destinationRectangle, Color color, float rotation, Vector2 origin, float depth)
         {
             Dictionary<Texture2D, Batch> batches;
 
@@ -208,6 +208,8 @@ namespace AtomicBlaster
 
             Batch batch;
 
+            var texture = sprite.Texture;
+
             if (!batches.TryGetValue(texture, out batch))
             {
                 batch = new Batch();
@@ -234,8 +236,8 @@ namespace AtomicBlaster
                         destinationRectangle.Z,
                         destinationRectangle.W,
                         color,
-                        _texCoordTL,
-                        _texCoordBR,
+                        sprite.TexCoordTL,
+                        sprite.TexCoordBR,
                         depth);
 
             }
@@ -250,8 +252,8 @@ namespace AtomicBlaster
                         (float)Math.Sin(rotation),
                         (float)Math.Cos(rotation),
                         color,
-                        _texCoordTL,
-                        _texCoordBR,
+                        sprite.TexCoordTL,
+                        sprite.TexCoordBR,
                         depth);
 
             }

+ 1 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/Enemy.cs

@@ -20,7 +20,7 @@ namespace AtomicBlaster
         public bool IsActive { get { return timeUntilStart <= 0; } }
         public int PointValue { get; private set; }
 
-        public Enemy(Texture2D image, Vector2 position)
+        public Enemy(CustomSprite image, Vector2 position)
         {
             this.image = image;
             Position = position;

+ 2 - 1
AtomicNET/AtomicBlaster/Resources/Scripts/Entity.cs

@@ -10,7 +10,8 @@ namespace AtomicBlaster
 {
     abstract class Entity
     {
-        protected Texture2D image;
+        protected CustomSprite image;
+
         // The tint of the image. This will also allow us to change the transparency.
         protected Color color = Color.White;
 

+ 2 - 0
AtomicNET/AtomicBlaster/Resources/Scripts/EntityManager.cs

@@ -129,8 +129,10 @@ namespace AtomicBlaster
                 return;
 
             PlayerShip.Instance.Kill();
+            /*
             enemies.ForEach(x => x.WasShot());
             blackHoles.ForEach(x => x.Kill());
+            */
             EnemySpawner.Reset();
         }
 

+ 7 - 2
AtomicNET/AtomicBlaster/Resources/Scripts/GameRoot.cs

@@ -11,10 +11,10 @@ using AtomicPlayer;
 namespace AtomicBlaster
 {
 
-    public class GameRoot : NETScriptObject  
+    public class GameRoot : AppDelegate 
     {
 
-        public GameRoot()
+        public override void Start()
         {
             Art.Load();
 
@@ -50,7 +50,12 @@ namespace AtomicBlaster
 
             ParticleManager = new ParticleManager<ParticleState>(1024 * 20, ParticleState.UpdateParticle);
 
+#if ATOMIC_DESKTOP
             const int maxGridPoints = 1600;
+#else
+            const int maxGridPoints = 400;
+#endif
+
             float amt = (float)Math.Sqrt(ScreenBounds.Width * ScreenBounds.Height / maxGridPoints);
             Vector2 gridSpacing = new Vector2(amt, amt);
             Grid = new Grid(ScreenBounds, gridSpacing);

+ 3 - 3
AtomicNET/AtomicBlaster/Resources/Scripts/ParticleManager.cs

@@ -75,12 +75,12 @@ namespace AtomicBlaster
             }
         }
 
-        public void CreateParticle(Texture2D texture, Vector2 position, Color tint, float duration, float scale, T state, float theta = 0)
+        public void CreateParticle(CustomSprite texture, Vector2 position, Color tint, float duration, float scale, T state, float theta = 0)
         {
             CreateParticle(texture, position, tint, duration, new Vector2(scale, scale), state, theta);
         }
 
-        public void CreateParticle(Texture2D texture, Vector2 position, Color tint, float duration, Vector2 scale, T state, float theta = 0)
+        public void CreateParticle(CustomSprite texture, Vector2 position, Color tint, float duration, Vector2 scale, T state, float theta = 0)
         {
             Particle particle;
             if (particleList.Count == particleList.Capacity)
@@ -122,7 +122,7 @@ namespace AtomicBlaster
 
         public class Particle
         {
-            public Texture2D Texture;
+            public CustomSprite Texture;
             public Vector2 Position;
             public float Orientation;
 

+ 0 - 20
AtomicNET/AtomicBlaster/Resources/Scripts/Program.cs

@@ -1,20 +0,0 @@
-using System;
-using AtomicEngine;
-
-namespace AtomicBlaster
-{
-    public static class AtomicMain
-    {
-        /// <summary>
-        /// The main entry point for the application.
-        /// </summary>
-        static void Main(string[] args)
-        {
-
-            gameroot = new GameRoot();
-            
-        }
-
-        public static GameRoot gameroot;
-    }
-}

+ 0 - 5
AtomicNET/AtomicBlaster/Resources/Scripts/Program.cs.asset

@@ -1,5 +0,0 @@
-{
-	"version": 1,
-	"guid": "c667cc2d9ce0c1ba072e9d64aa63e00a",
-	"CSharpImporter": null
-}

+ 52 - 0
AtomicNET/AtomicBlaster/Resources/Scripts/ShipInput.cs

@@ -5,6 +5,7 @@
 //----------------------------------------------------------------------------------
 
 using System;
+using System.IO;
 using AtomicEngine;
 
 namespace AtomicBlaster
@@ -34,6 +35,28 @@ namespace AtomicBlaster
             if (input.GetKeyDown((int)SDL.SDL_Keycode.SDLK_w))
                 direction.Y += 1;
 
+
+            uint numJoySticks = input.GetNumJoysticks();
+
+            if (numJoySticks > 0)
+            {
+                var state = input.GetJoystickByIndex(0);
+
+                float x = state.GetAxisPosition(0);
+                float y = state.GetAxisPosition(1);
+
+                if (x < -0.15f)
+                    direction.X = x;
+                if (x > 0.15f)
+                    direction.X = x;
+
+                if (y < -0.15f)
+                    direction.Y = -y;
+                if (y > 0.15f)
+                    direction.Y = -y;
+
+            }
+
             // Clamp the length of the vector to a maximum of 1.
             if (direction.LengthSquared > 1)
                 direction.Normalize();
@@ -50,6 +73,35 @@ namespace AtomicBlaster
         {
             var input = AtomicNET.GetSubsystem<Input>();
 
+            uint numJoySticks = input.GetNumJoysticks();
+
+            if (numJoySticks > 0)
+            {
+                Vector2 dir = new Vector2(0, 0);
+
+                var state = input.GetJoystickByIndex(0);
+
+                float x = state.GetAxisPosition(0);
+                float y = state.GetAxisPosition(1);
+
+                if (x < -0.15f)
+                    dir.X = x;
+                if (x > 0.15f)
+                    dir.X = x;
+
+                if (y < -0.15f)
+                    dir.Y = -y;
+                if (y > 0.15f)
+                    dir.Y = -y;
+
+                // Clamp the length of the vector to a maximum of 1.
+                if (dir.LengthSquared > 1)
+                    dir.Normalize();
+
+                return dir;
+
+            }
+
             Vector2 direction = new Vector2((float)input.GetMousePosition().X, (float)input.GetMousePosition().Y);            
 
             Vector2 shipPos = PlayerShip.Instance.Position;

+ 0 - 0
AtomicNET/AtomicBlaster/Resources/Scripts/Sprites.cs


+ 5 - 0
AtomicNET/AtomicBlaster/Resources/Scripts/Sprites.cs.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "4c3c7021ddedf6b09d915a1139a510cf",
+	"CSharpImporter": null
+}

+ 0 - 157
AtomicNET/AtomicBlaster/Resources/Sprites/AtomicBlasterSprites.plist

@@ -1,157 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-    <dict>
-        <key>frames</key>
-        <dict>
-            <key>BlackHole.png</key>
-            <dict>
-                <key>aliases</key>
-                <array/>
-                <key>spriteOffset</key>
-                <string>{0,0}</string>
-                <key>spriteSize</key>
-                <string>{40,40}</string>
-                <key>spriteSourceSize</key>
-                <string>{40,40}</string>
-                <key>textureRect</key>
-                <string>{{1,1},{40,40}}</string>
-                <key>textureRotated</key>
-                <false/>
-            </dict>
-            <key>Bullet.png</key>
-            <dict>
-                <key>aliases</key>
-                <array/>
-                <key>spriteOffset</key>
-                <string>{0,0}</string>
-                <key>spriteSize</key>
-                <string>{28,9}</string>
-                <key>spriteSourceSize</key>
-                <string>{28,9}</string>
-                <key>textureRect</key>
-                <string>{{43,1},{28,9}}</string>
-                <key>textureRotated</key>
-                <false/>
-            </dict>
-            <key>Glow.png</key>
-            <dict>
-                <key>aliases</key>
-                <array/>
-                <key>spriteOffset</key>
-                <string>{0,0}</string>
-                <key>spriteSize</key>
-                <string>{35,20}</string>
-                <key>spriteSourceSize</key>
-                <string>{35,20}</string>
-                <key>textureRect</key>
-                <string>{{73,1},{35,20}}</string>
-                <key>textureRotated</key>
-                <false/>
-            </dict>
-            <key>Laser.png</key>
-            <dict>
-                <key>aliases</key>
-                <array/>
-                <key>spriteOffset</key>
-                <string>{0,0}</string>
-                <key>spriteSize</key>
-                <string>{22,2}</string>
-                <key>spriteSourceSize</key>
-                <string>{22,2}</string>
-                <key>textureRect</key>
-                <string>{{1,43},{22,2}}</string>
-                <key>textureRotated</key>
-                <false/>
-            </dict>
-            <key>Pixel.png</key>
-            <dict>
-                <key>aliases</key>
-                <array/>
-                <key>spriteOffset</key>
-                <string>{0,0}</string>
-                <key>spriteSize</key>
-                <string>{16,16}</string>
-                <key>spriteSourceSize</key>
-                <string>{16,16}</string>
-                <key>textureRect</key>
-                <string>{{25,43},{16,16}}</string>
-                <key>textureRotated</key>
-                <false/>
-            </dict>
-            <key>Player.png</key>
-            <dict>
-                <key>aliases</key>
-                <array/>
-                <key>spriteOffset</key>
-                <string>{0,0}</string>
-                <key>spriteSize</key>
-                <string>{40,40}</string>
-                <key>spriteSourceSize</key>
-                <string>{40,40}</string>
-                <key>textureRect</key>
-                <string>{{43,43},{40,40}}</string>
-                <key>textureRotated</key>
-                <false/>
-            </dict>
-            <key>Pointer.png</key>
-            <dict>
-                <key>aliases</key>
-                <array/>
-                <key>spriteOffset</key>
-                <string>{0,0}</string>
-                <key>spriteSize</key>
-                <string>{22,31}</string>
-                <key>spriteSourceSize</key>
-                <string>{22,31}</string>
-                <key>textureRect</key>
-                <string>{{85,43},{22,31}}</string>
-                <key>textureRotated</key>
-                <false/>
-            </dict>
-            <key>Seeker.png</key>
-            <dict>
-                <key>aliases</key>
-                <array/>
-                <key>spriteOffset</key>
-                <string>{0,0}</string>
-                <key>spriteSize</key>
-                <string>{40,32}</string>
-                <key>spriteSourceSize</key>
-                <string>{40,40}</string>
-                <key>textureRect</key>
-                <string>{{1,85},{40,32}}</string>
-                <key>textureRotated</key>
-                <false/>
-            </dict>
-            <key>Wanderer.png</key>
-            <dict>
-                <key>aliases</key>
-                <array/>
-                <key>spriteOffset</key>
-                <string>{0,0}</string>
-                <key>spriteSize</key>
-                <string>{40,40}</string>
-                <key>spriteSourceSize</key>
-                <string>{40,40}</string>
-                <key>textureRect</key>
-                <string>{{43,85},{40,40}}</string>
-                <key>textureRotated</key>
-                <false/>
-            </dict>
-        </dict>
-        <key>metadata</key>
-        <dict>
-            <key>format</key>
-            <integer>3</integer>
-            <key>realTextureFileName</key>
-            <string>AtomicBlasterSprites.png</string>
-            <key>size</key>
-            <string>{128,128}</string>
-            <key>smartupdate</key>
-            <string>$TexturePacker:SmartUpdate:239e49e98f80103e023f0c0a3ec4cf99:ef38c18e0c31ec79c71fe241a3e0b58c:ab24a4a6a71b325297f3a046ad1ecd48$</string>
-            <key>textureFileName</key>
-            <string>AtomicBlasterSprites.png</string>
-        </dict>
-    </dict>
-</plist>

BIN
AtomicNET/AtomicBlaster/Resources/Sprites/AtomicBlasterSprites.png


+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Sprites/AtomicBlasterSprites.png.asset

@@ -1,5 +1,7 @@
 {
 	"version": 1,
 	"guid": "8544c43203a051e2153d4be7b88cbefc",
-	"TextureImporter": {}
+	"TextureImporter": {
+		"compressionSize": 0
+	}
 }

+ 14 - 0
AtomicNET/AtomicBlaster/Resources/Sprites/AtomicBlasterSprites.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Created with TexturePacker http://www.codeandweb.com/texturepacker-->
+<!-- $TexturePacker:SmartUpdate:1e7751cddc6af1fea2f5c94770111b22:4d7db391caa9b8353f09180c10945988:9ff89a500ef7012dc1f491d9680e0af5$ -->
+<TextureAtlas imagePath="AtomicBlasterSprites.png" width="128" height="128">
+    <SubTexture name="BlackHole" x="1" y="1" width="40" height="40"/>
+    <SubTexture name="Bullet" x="85" y="23" width="28" height="9"/>
+    <SubTexture name="Glow" x="85" y="1" width="35" height="20"/>
+    <SubTexture name="Laser" x="43" y="35" width="22" height="2"/>
+    <SubTexture name="Pixel" x="122" y="1" width="1" height="1"/>
+    <SubTexture name="Player" x="1" y="43" width="40" height="40"/>
+    <SubTexture name="Pointer" x="85" y="34" width="22" height="31"/>
+    <SubTexture name="Seeker" x="43" y="1" width="40" height="32" frameX="0" frameY="-4" frameWidth="40" frameHeight="40"/>
+    <SubTexture name="Wanderer" x="1" y="85" width="40" height="40"/>
+</TextureAtlas>

+ 5 - 0
AtomicNET/AtomicBlaster/Resources/Sprites/AtomicBlasterSprites.xml.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "23d8403067b7645499e7eecc44c6290e",
+	"TextImporter": {}
+}

+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Sprites/BlackHole.png.asset

@@ -1,5 +1,7 @@
 {
 	"version": 1,
 	"guid": "d1cd069c77c523d8fe95ca3cfaa34a65",
-	"TextureImporter": {}
+	"TextureImporter": {
+		"compressionSize": 0
+	}
 }

+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Sprites/Bullet.png.asset

@@ -1,5 +1,7 @@
 {
 	"version": 1,
 	"guid": "9e5ffb024e1fc627634b021f2fcbcf8b",
-	"TextureImporter": {}
+	"TextureImporter": {
+		"compressionSize": 0
+	}
 }

+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Sprites/Glow.png.asset

@@ -1,5 +1,7 @@
 {
 	"version": 1,
 	"guid": "a07df9467c7cf95737e58d2754a92b24",
-	"TextureImporter": {}
+	"TextureImporter": {
+		"compressionSize": 0
+	}
 }

+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Sprites/Laser.png.asset

@@ -1,5 +1,7 @@
 {
 	"version": 1,
 	"guid": "ec31b801fb2f53fd6438a028372866de",
-	"TextureImporter": {}
+	"TextureImporter": {
+		"compressionSize": 0
+	}
 }

+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Sprites/Pixel.png.asset

@@ -1,5 +1,7 @@
 {
 	"version": 1,
 	"guid": "8a897903859a1ced48d2629264c1d21a",
-	"TextureImporter": {}
+	"TextureImporter": {
+		"compressionSize": 0
+	}
 }

+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Sprites/Player.png.asset

@@ -1,5 +1,7 @@
 {
 	"version": 1,
 	"guid": "dd6e6adb13bfe21f701da3bc8f1f6528",
-	"TextureImporter": {}
+	"TextureImporter": {
+		"compressionSize": 0
+	}
 }

+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Sprites/Pointer.png.asset

@@ -1,5 +1,7 @@
 {
 	"version": 1,
 	"guid": "c8e579b9cb25fd507679321a483134bb",
-	"TextureImporter": {}
+	"TextureImporter": {
+		"compressionSize": 0
+	}
 }

+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Sprites/Seeker.png.asset

@@ -1,5 +1,7 @@
 {
 	"version": 1,
 	"guid": "1593f0db6699f5483081cef28cf01183",
-	"TextureImporter": {}
+	"TextureImporter": {
+		"compressionSize": 0
+	}
 }

+ 3 - 1
AtomicNET/AtomicBlaster/Resources/Sprites/Wanderer.png.asset

@@ -1,5 +1,7 @@
 {
 	"version": 1,
 	"guid": "fafe1cd29166750cccbbd4e22b55acd2",
-	"TextureImporter": {}
+	"TextureImporter": {
+		"compressionSize": 0
+	}
 }

+ 4 - 0
AtomicNET/AtomicBlaster/Settings/Project.json

@@ -0,0 +1,4 @@
+{
+    "name" : "AtomicBlaster",
+    "platforms": ["desktop"]
+}

+ 1 - 1
AtomicNET/Butterflies/.gitignore

@@ -2,4 +2,4 @@ UserPrefs.json
 BuildSettings.json
 Cache/*
 AtomicNET/*
-Resources/AtomicProject.*
+Resources/AtomicButterflies.*

+ 64 - 0
AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/MainActivity.cs

@@ -0,0 +1,64 @@
+using Android.App;
+using Android.Content.PM;
+using Android.Widget;
+using Android.OS;
+using Android.Views;
+using AtomicEngine;
+
+using AtomicBlaster;
+
+namespace AtomicPlayer
+{
+	[Activity(Label = "AtomicPlayer", MainLauncher = true,
+		Icon = "@drawable/icon", Theme = "@android:style/Theme.NoTitleBar.Fullscreen",
+		ConfigurationChanges = ConfigChanges.KeyboardHidden | ConfigChanges.Orientation,
+		ScreenOrientation = ScreenOrientation.Landscape)]
+	public class MainActivity : Activity
+	{
+		protected override void OnCreate(Bundle bundle)
+		{
+			base.OnCreate(bundle);
+			var mLayout = new AbsoluteLayout(this);
+            var surface = AndroidSDLSurface.CreateSurface(this, false, typeof(GameRoot));
+			mLayout.AddView(surface);
+			SetContentView(mLayout);
+		}
+
+		protected override void OnResume()
+		{
+            AndroidSDLSurface.OnResume();
+			base.OnResume();
+		}
+
+		protected override void OnPause()
+		{
+            AndroidSDLSurface.OnPause();
+			base.OnPause();
+		}
+
+		public override void OnLowMemory()
+		{
+            AndroidSDLSurface.OnLowMemory();
+			base.OnLowMemory();
+		}
+
+		protected override void OnDestroy()
+		{
+            AndroidSDLSurface.OnDestroy();
+			base.OnDestroy();
+		}
+
+		public override bool DispatchKeyEvent(KeyEvent e)
+		{
+			if (!AndroidSDLSurface.DispatchKeyEvent(e))
+				return false;
+			return base.DispatchKeyEvent(e);
+		}
+
+		public override void OnWindowFocusChanged(bool hasFocus)
+		{
+            AndroidSDLSurface.OnWindowFocusChanged(hasFocus);
+			base.OnWindowFocusChanged(hasFocus);
+		}
+	}
+}

+ 5 - 0
AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/Properties/AndroidManifest.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="AtomicBlaster.AtomicBlaster" android:versionCode="1" android:versionName="1.0">
+	<uses-sdk android:minSdkVersion="16" />
+	<application android:label="AtomicBlaster"></application>
+</manifest>

+ 30 - 0
AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/Properties/AssemblyInfo.cs

@@ -0,0 +1,30 @@
+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("AtomicBlaster")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("AtomicBlaster")]
+[assembly: AssemblyCopyright("Copyright © 2016")]
+[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")]

+ 80 - 0
AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/Resources/Resource.Designer.cs

@@ -0,0 +1,80 @@
+#pragma warning disable 1591
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+[assembly: global::Android.Runtime.ResourceDesignerAttribute("Application.Resource", IsApplication=true)]
+
+namespace Application
+{
+	
+	
+	[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: 0x7f020000
+			public const int icon = 2130837504;
+			
+			static Drawable()
+			{
+				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
+			}
+			
+			private Drawable()
+			{
+			}
+		}
+		
+		public partial class String
+		{
+			
+			// aapt resource value: 0x7f030001
+			public const int ApplicationName = 2130903041;
+			
+			// aapt resource value: 0x7f030000
+			public const int app_name = 2130903040;
+			
+			static String()
+			{
+				global::Android.Runtime.ResourceIdManager.UpdateIdValues();
+			}
+			
+			private String()
+			{
+			}
+		}
+	}
+}
+#pragma warning restore 1591

BIN
AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/Resources/drawable/icon.png


+ 4 - 0
AtomicNET/Butterflies/Project/AtomicNET/Platforms/Android/Resources/values/Strings.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="ApplicationName">AtomicBlaster</string>
+</resources>

+ 17 - 0
AtomicNET/Butterflies/Project/AtomicNET/Platforms/Desktop/Program.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Linq;
+
+using AtomicEngine;
+
+namespace AtomicPlayer
+{
+    public class Program
+    {
+        public static void Main(string[] args)
+        {
+            Application.Run<AtomicMain>(args);
+        }
+    }
+}

+ 0 - 5
AtomicNET/Butterflies/Resources.asset

@@ -1,5 +0,0 @@
-{
-	"version": 1,
-	"guid": "c5a14ededf7c8df707fd8b3f83ffe0d3",
-	"FolderImporter": {}
-}

+ 1 - 1
AtomicNET/Butterflies/Resources/Scenes/TheScene.scene

@@ -64,7 +64,7 @@
 		<attribute name="Scale" value="1 1 1" />
 		<attribute name="Variables" />
 		<component type="CSComponent" id="1975">
-			<attribute name="Assembly" value="CSComponentAssembly;AtomicProject.dll" />
+			<attribute name="Assembly" value="CSComponentAssembly;AtomicButterflies.dll" />
 			<attribute name="Class" value="Spawner" />
 		</component>
 	</node>

+ 7 - 0
AtomicNET/Butterflies/Resources/Scripts/AtomicMain.cs

@@ -0,0 +1,7 @@
+using AtomicEngine;
+using AtomicPlayer;
+
+public class AtomicMain : AppDelegate
+{
+
+}

+ 5 - 0
AtomicNET/Butterflies/Resources/Scripts/AtomicMain.cs.asset

@@ -0,0 +1,5 @@
+{
+	"version": 1,
+	"guid": "c0e2a36de0ee2780a3926dd9b39ef507",
+	"CSharpImporter": null
+}

+ 4 - 0
AtomicNET/Butterflies/Settings/Project.json

@@ -0,0 +1,4 @@
+{
+    "name" : "AtomicButterflies",
+    "platforms": ["desktop"]
+}