]> git.r.bdr.sh - rbdr/super-polarity/commitdiff
Moves some files around!
authorBen Beltran <redacted>
Sat, 31 May 2014 17:39:02 +0000 (12:39 -0500)
committerBen Beltran <redacted>
Sat, 31 May 2014 17:39:02 +0000 (12:39 -0500)
15 files changed:
SuperPolarity.userprefs
SuperPolarity/Actors/Actor.cs
SuperPolarity/Actors/Bullet.cs
SuperPolarity/Actors/GameActor.cs [new file with mode: 0644]
SuperPolarity/Actors/Generators/Generator.cs
SuperPolarity/Actors/MainShip.cs
SuperPolarity/Actors/Ship.cs
SuperPolarityMac/Actors/Generators/FanGenerator.cs [deleted file]
SuperPolarityMac/Actors/Generators/Generator.cs [deleted file]
SuperPolarityMac/Actors/Generators/LineGenerator.cs [deleted file]
SuperPolarityMac/Actors/Generators/PointGenerator.cs [deleted file]
SuperPolarityMac/Actors/Generators/RingGenerator.cs [deleted file]
SuperPolarityMac/Actors/Generators/WaveGenerator.cs [deleted file]
SuperPolarityMac/SuperPolarityMac.csproj
SuperPolarityMac/SuperPolarityMac.userprefs

index beb7836d0596aa0529487742c51698940a0ce3b4..695350a074aea097c073ff0e2d14c44df6fe0e34 100644 (file)
@@ -5,8 +5,7 @@
       <File FileName="SuperPolarity/Program.cs" Line="1" Column="1" />
       <File FileName="SuperPolarityMac/Program.cs" Line="1" Column="1" />
       <File FileName="SuperPolarity/SuperPolarity.cs" Line="61" Column="13" />
       <File FileName="SuperPolarity/Program.cs" Line="1" Column="1" />
       <File FileName="SuperPolarityMac/Program.cs" Line="1" Column="1" />
       <File FileName="SuperPolarity/SuperPolarity.cs" Line="61" Column="13" />
-      <File FileName="SuperPolarityMac/SuperPolarity.cs" Line="98" Column="22" />
-      <File FileName="SuperPolarityLinux/Program.cs" Line="22" Column="4" />
+      <File FileName="SuperPolarityLinux/Program.cs" Line="1" Column="1" />
     </Files>
   </MonoDevelop.Ide.Workbench>
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
     </Files>
   </MonoDevelop.Ide.Workbench>
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
index 5e7e482781af182d63aaeefb813970bae1945dc1..2c6a895e104150d4067cc0233db3cee9363e27a8 100644 (file)
@@ -14,13 +14,12 @@ namespace SuperPolarity
 
         public List<Actor> Children;
 
 
         public List<Actor> Children;
 
-        // Graphics / In-Game
-        protected Texture2D Texture;
-        protected Vector2 Origin;
+        // In-Game Properties
         public bool Active;
         public bool Active;
-        public Rectangle Box;
-        public Vector4 BoxDimensions;
-        protected Texture2D BoxTexture;
+               public Rectangle Box;
+               public Vector4 BoxDimensions;
+               protected Texture2D BoxTexture;
+               protected Color Color;
 
         // Physical Properties
         public Vector2 Position;
 
         // Physical Properties
         public Vector2 Position;
@@ -31,68 +30,58 @@ namespace SuperPolarity
 
         // Constraints / Behavior
         public float MaxVelocity;
 
         // Constraints / Behavior
         public float MaxVelocity;
-        protected float AccelerationRate;
-        public int HP;
-        protected bool Immortal;
+               protected float AccelerationRate;
         public bool Dying;
         public bool Dying;
-        public int Value;
-        protected Color Color;
 
         public Actor Parent;
 
 
         public Actor Parent;
 
-        public int Width
+        public virtual int Width
         {
         {
-            get { return Texture.Width; }
+            get { return 0; }
         }
 
         }
 
-        public int Height
+        public virtual int Height
         {
         {
-            get { return Texture.Height; }
+            get { return 0; }
         }
 
         public Actor(SuperPolarity newGame)
         {
             game = newGame;
         }
 
         public Actor(SuperPolarity newGame)
         {
             game = newGame;
-            BoxDimensions.X = 20;
-            BoxDimensions.Y = 20;
-            BoxDimensions.W = 15;
-            BoxDimensions.Z = 15;
+                       BoxDimensions.X = 20;
+                       BoxDimensions.Y = 20;
+                       BoxDimensions.W = 15;
+                       BoxDimensions.Z = 15;
         }
 
         }
 
-        public virtual void Initialize(Texture2D texture, Vector2 position)
+        public virtual void Initialize(Vector2 position)
         {
         {
-            Texture = texture;
             Position = position;
             Active = true;
 
             Position = position;
             Active = true;
 
-                       Collides = true;
+                       Collides = false;
 
             Children = new List<Actor>();
 
 
             Children = new List<Actor>();
 
-            Origin = new Vector2(Texture.Width / 2, Texture.Height / 2);
             Velocity = new Vector2(0, 0);
             Acceleration = new Vector2(0, 0);
 
             MaxVelocity = 5;
             AccelerationRate = 10;
 
             Velocity = new Vector2(0, 0);
             Acceleration = new Vector2(0, 0);
 
             MaxVelocity = 5;
             AccelerationRate = 10;
 
-            HP = 1;
-            Immortal = false;
-
             Dying = false;
             Dying = false;
-            Value = 1;
 
 
-            InitBox();
-            BoxTexture = new Texture2D(game.GraphicsDevice, 1, 1);
-            BoxTexture.SetData(new Color[] { Color.White });
+                       InitBox();
+                       BoxTexture = new Texture2D(game.GraphicsDevice, 1, 1);
+                       BoxTexture.SetData(new Color[] { Color.White });
 
             Color = Color.White;
         }
 
 
             Color = Color.White;
         }
 
-        protected void InitBox()
-        {
-            Box = new Rectangle((int)(Position.X - BoxDimensions.X), (int)(Position.Y - BoxDimensions.X), (int)(BoxDimensions.X + BoxDimensions.X + BoxDimensions.W), (int)(BoxDimensions.Y + BoxDimensions.Y + BoxDimensions.Z));
-        }
+               protected void InitBox()
+               {
+                       Box = new Rectangle((int)(Position.X - BoxDimensions.X), (int)(Position.Y - BoxDimensions.X), (int)(BoxDimensions.X + BoxDimensions.X + BoxDimensions.W), (int)(BoxDimensions.Y + BoxDimensions.Y + BoxDimensions.Z));
+               }
 
         public void AutoDeccelerate(GameTime gameTime)
         {
 
         public void AutoDeccelerate(GameTime gameTime)
         {
@@ -154,21 +143,19 @@ namespace SuperPolarity
             Move(gameTime);
             ChangeAngle();
             CheckOutliers();
             Move(gameTime);
             ChangeAngle();
             CheckOutliers();
-            UpdateBox();
+                       UpdateBox ();
         }
 
         }
 
-        protected virtual void UpdateBox()
-        {
-            Box.X = (int)(Position.X - BoxDimensions.X);
-            Box.Y = (int)(Position.Y - BoxDimensions.Y);
-        }
+               protected virtual void UpdateBox()
+               {
+                       Box.X = (int)(Position.X - BoxDimensions.X);
+                       Box.Y = (int)(Position.Y - BoxDimensions.Y);
+               }
 
         public virtual void Move(GameTime gameTime)
         {
             AutoDeccelerate(gameTime);
 
 
         public virtual void Move(GameTime gameTime)
         {
             AutoDeccelerate(gameTime);
 
-            var maxVelocity = MaxVelocity;
-
             Velocity.X = Velocity.X + Acceleration.X * (float)gameTime.ElapsedGameTime.TotalSeconds;
             Velocity.Y = Velocity.Y + Acceleration.Y * (float)gameTime.ElapsedGameTime.TotalSeconds;
 
             Velocity.X = Velocity.X + Acceleration.X * (float)gameTime.ElapsedGameTime.TotalSeconds;
             Velocity.Y = Velocity.Y + Acceleration.Y * (float)gameTime.ElapsedGameTime.TotalSeconds;
 
@@ -220,8 +207,7 @@ namespace SuperPolarity
                 child.Draw(spriteBatch);
             }
 
                 child.Draw(spriteBatch);
             }
 
-            spriteBatch.Draw(Texture, Position, null, Color, Angle, Origin, 1f, SpriteEffects.None, 0f);
-            //spriteBatch.Draw(BoxTexture, Box, new Color(255, 0, 255, 25));
+                       //spriteBatch.Draw(BoxTexture, Box, new Color(255, 0, 255, 25));
         }
 
         void CheckOutliers()
         }
 
         void CheckOutliers()
@@ -242,18 +228,6 @@ namespace SuperPolarity
         {
         }
 
         {
         }
 
-        public void TakeDamage(int amount)
-        {
-            if (!Immortal)
-            {
-                HP = HP - amount;
-                if (HP < 0)
-                {
-                    Die();
-                }
-            }
-        }
-
         protected virtual void Die()
         {
             Dying = true;
         protected virtual void Die()
         {
             Dying = true;
@@ -261,10 +235,8 @@ namespace SuperPolarity
 
         public virtual void CleanUp()
         {
 
         public virtual void CleanUp()
         {
-            Texture = null;
-            BoxTexture = null;
-            Children = null;
-            Texture = null;
+                       BoxTexture = null;
+                       Children = null;
         }
     }
 }
         }
     }
 }
index d20289cd536aa832ac8a1e7d5ff2764877474c87..13d61c15007950172ca79d1535ef9e11334efb97 100644 (file)
@@ -7,7 +7,7 @@ using Microsoft.Xna.Framework.Graphics;
 
 namespace SuperPolarity
 {
 
 namespace SuperPolarity
 {
-    class Bullet : Actor
+    class Bullet : GameActor
     {
         protected ParticleEngine particleEngine;
         public int Power;
     {
         protected ParticleEngine particleEngine;
         public int Power;
diff --git a/SuperPolarity/Actors/GameActor.cs b/SuperPolarity/Actors/GameActor.cs
new file mode 100644 (file)
index 0000000..8015ffa
--- /dev/null
@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace SuperPolarity
+{
+    public class GameActor : Actor
+    {
+        // Graphics / In-Game
+        protected Texture2D Texture;
+        protected Vector2 Origin;
+
+        // Constraints / Behavior
+        public int HP;
+        protected bool Immortal;
+        public int Value;
+
+        public override int Width
+        {
+            get { return Texture.Width; }
+        }
+
+        public override int Height
+        {
+            get { return Texture.Height; }
+        }
+
+               public GameActor(SuperPolarity newGame)
+                       : base(newGame)
+               {
+               }
+
+        public virtual void Initialize(Texture2D texture, Vector2 position)
+        {
+                       base.Initialize (position);
+
+            Texture = texture;
+
+                       Collides = true;
+
+            Origin = new Vector2(Texture.Width / 2, Texture.Height / 2);
+
+            HP = 1;
+            Immortal = false;
+
+            Value = 1;
+                       InitBox ();
+        }
+
+        public override void Draw(SpriteBatch spriteBatch)
+        {
+                       base.Draw(spriteBatch);
+
+            spriteBatch.Draw(Texture, Position, null, Color, Angle, Origin, 1f, SpriteEffects.None, 0f);
+        }
+
+        public override void CleanUp()
+        {
+                       base.CleanUp ();
+            Texture = null;
+        }
+
+               
+               public void TakeDamage(int amount)
+               {
+                       if (!Immortal)
+                       {
+                               HP = HP - amount;
+                               if (HP < 0)
+                               {
+                                       Die();
+                               }
+                       }
+               }
+    }
+}
index dfbc40ba87f5697750afd339dfc937626b67248f..4e2cc3eba3985c2feac07dbc95c2cdf13f7dbfb0 100644 (file)
@@ -9,6 +9,12 @@ namespace SuperPolarity
                {
                        Collides = false;
                }
                {
                        Collides = false;
                }
+
+               public override void Draw (Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
+               {
+                       base.Draw (spriteBatch);
+                       spriteBatch.Draw(BoxTexture, Box, new Color(255, 0, 255, 25));
+               }
        }
 }
 
        }
 }
 
index bf4f3bbcfc65100f0860707e823ec546ce6880d8..307bef430e6a1167445074baffe737cf5f84a488 100644 (file)
@@ -274,11 +274,12 @@ namespace SuperPolarity
         {
             particleEngine.Draw(spriteBatch);
             base.Draw(spriteBatch);
         {
             particleEngine.Draw(spriteBatch);
             base.Draw(spriteBatch);
+                       spriteBatch.Draw(BoxTexture, Box, new Color(255, 0, 255, 25));
         }
 
         public override void Collide(Actor other, Rectangle collision)
         {
         }
 
         public override void Collide(Actor other, Rectangle collision)
         {
-            if (other.GetType().IsAssignableFrom(typeof(StandardShip)) &&
+          if (other.GetType().IsAssignableFrom(typeof(StandardShip)) &&
                             !Immortal)
             {
                 Die();
                             !Immortal)
             {
                 Die();
index 229f639ea4945cf16b4819aabb2ba5ee8c51cb19..5a3f6e540d8bbbe33b332259fe8095c2898670c0 100644 (file)
@@ -7,7 +7,7 @@ using Microsoft.Xna.Framework.Graphics;
 
 namespace SuperPolarity
 {
 
 namespace SuperPolarity
 {
-    class Ship : Actor
+    class Ship : GameActor
     {
         public enum Polarity : byte { Negative, Positive, Neutral };
 
     {
         public enum Polarity : byte { Negative, Positive, Neutral };
 
diff --git a/SuperPolarityMac/Actors/Generators/FanGenerator.cs b/SuperPolarityMac/Actors/Generators/FanGenerator.cs
deleted file mode 100644 (file)
index ea080a7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace SuperPolarityMac
-{
-       public class FanGenerator
-       {
-               public FanGenerator ()
-               {
-               }
-       }
-}
-
diff --git a/SuperPolarityMac/Actors/Generators/Generator.cs b/SuperPolarityMac/Actors/Generators/Generator.cs
deleted file mode 100644 (file)
index ce8538a..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace SuperPolarityMac
-{
-       public class Generator
-       {
-               public Generator ()
-               {
-               }
-       }
-}
-
diff --git a/SuperPolarityMac/Actors/Generators/LineGenerator.cs b/SuperPolarityMac/Actors/Generators/LineGenerator.cs
deleted file mode 100644 (file)
index b7250cb..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace SuperPolarityMac
-{
-       public class LineGenerator
-       {
-               public LineGenerator ()
-               {
-               }
-       }
-}
-
diff --git a/SuperPolarityMac/Actors/Generators/PointGenerator.cs b/SuperPolarityMac/Actors/Generators/PointGenerator.cs
deleted file mode 100644 (file)
index 16a6e36..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace SuperPolarityMac
-{
-       public class PointGenerator
-       {
-               public PointGenerator ()
-               {
-               }
-       }
-}
-
diff --git a/SuperPolarityMac/Actors/Generators/RingGenerator.cs b/SuperPolarityMac/Actors/Generators/RingGenerator.cs
deleted file mode 100644 (file)
index fe0ab26..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace SuperPolarityMac
-{
-       public class RingGenerator
-       {
-               public RingGenerator ()
-               {
-               }
-       }
-}
-
diff --git a/SuperPolarityMac/Actors/Generators/WaveGenerator.cs b/SuperPolarityMac/Actors/Generators/WaveGenerator.cs
deleted file mode 100644 (file)
index 8249bb0..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-using System;
-
-namespace SuperPolarityMac
-{
-       public class WaveGenerator
-       {
-               public WaveGenerator ()
-               {
-               }
-       }
-}
-
index caf0a51c0416055c3b1d285671d07cb66c253b1d..740745a40025e2a4aa6355adfa6233917364081e 100644 (file)
@@ -11,6 +11,7 @@
     <RootNamespace>SuperPolarityMac</RootNamespace>
     <MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
     <AssemblyName>SuperPolarityMac</AssemblyName>
     <RootNamespace>SuperPolarityMac</RootNamespace>
     <MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
     <AssemblyName>SuperPolarityMac</AssemblyName>
+    <SuppressXamMacUpsell>True</SuppressXamMacUpsell>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
       <Link>Properties\AssemblyInfo.cs</Link>
     </Compile>
     <Compile Include="Program.cs" />
       <Link>Properties\AssemblyInfo.cs</Link>
     </Compile>
     <Compile Include="Program.cs" />
+    <Compile Include="..\SuperPolarity\Actors\Generators\FanGenerator.cs">
+      <Link>Actors\Generators\FanGenerator.cs</Link>
+    </Compile>
+    <Compile Include="..\SuperPolarity\Actors\Generators\Generator.cs">
+      <Link>Actors\Generators\Generator.cs</Link>
+    </Compile>
+    <Compile Include="..\SuperPolarity\Actors\Generators\LineGenerator.cs">
+      <Link>Actors\Generators\LineGenerator.cs</Link>
+    </Compile>
+    <Compile Include="..\SuperPolarity\Actors\Generators\PointGenerator.cs">
+      <Link>Actors\Generators\PointGenerator.cs</Link>
+    </Compile>
+    <Compile Include="..\SuperPolarity\Actors\Generators\RingGenerator.cs">
+      <Link>Actors\Generators\RingGenerator.cs</Link>
+    </Compile>
+    <Compile Include="..\SuperPolarity\Actors\Generators\WaveGenerator.cs">
+      <Link>Actors\Generators\WaveGenerator.cs</Link>
+    </Compile>
+    <Compile Include="..\SuperPolarity\Actors\GameActor.cs">
+      <Link>Actors\GameActor.cs</Link>
+    </Compile>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\SuperPolarity\Icon.ico">
   </ItemGroup>
   <ItemGroup>
     <None Include="..\SuperPolarity\Icon.ico">
     <Folder Include="Properties\" />
     <Folder Include="Content\Sound\" />
     <Folder Include="Vendor\" />
     <Folder Include="Properties\" />
     <Folder Include="Content\Sound\" />
     <Folder Include="Vendor\" />
+    <Folder Include="Actors\Generators\" />
   </ItemGroup>
   <ItemGroup>
     <BundleResource Include="..\SuperPolarity\Content\Graphics\circle.xnb">
   </ItemGroup>
   <ItemGroup>
     <BundleResource Include="..\SuperPolarity\Content\Graphics\circle.xnb">
index a83111a250a9b87986557f20d2477caf62e77b4d..9c0cef435d3ea188125dbb90d113744505b50b87 100644 (file)
@@ -1,9 +1,16 @@
-<Properties MonoDevelop.MonoMac.LastXamMacNagTime="2/21/2014 5:12:10 AM">
+<Properties MonoDevelop.MonoMac.LastXamMacNagTime="5/31/2014 4:22:16 PM">
   <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
   <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
-  <MonoDevelop.Ide.Workbench ActiveDocument="../SuperPolarity/SuperPolarity.cs">
+  <MonoDevelop.Ide.Workbench ActiveDocument="Actors/Generators/RingGenerator.cs">
     <Files>
     <Files>
-      <File FileName="../SuperPolarity/SuperPolarity.cs" Line="66" Column="43" />
-      <File FileName="../SuperPolarity/GameScreen.cs" Line="1" Column="1" />
+      <File FileName="../SuperPolarity/Actors/Bullet.cs" Line="15" Column="1" />
+      <File FileName="Actors/Generators/Generator.cs" Line="10" Column="21" />
+      <File FileName="Actors/Generators/FanGenerator.cs" Line="7" Column="13" />
+      <File FileName="Actors/Generators/LineGenerator.cs" Line="7" Column="14" />
+      <File FileName="Actors/Generators/PointGenerator.cs" Line="7" Column="15" />
+      <File FileName="Actors/Generators/RingGenerator.cs" Line="11" Column="3" />
+      <File FileName="Actors/Generators/WaveGenerator.cs" Line="7" Column="14" />
+      <File FileName="../SuperPolarity/Actors/Actor.cs" Line="68" Column="19" />
+      <File FileName="../SuperPolarity/ActorManager.cs" Line="163" Column="1" />
     </Files>
   </MonoDevelop.Ide.Workbench>
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
     </Files>
   </MonoDevelop.Ide.Workbench>
   <MonoDevelop.Ide.DebuggingService.Breakpoints>