]> git.r.bdr.sh - rbdr/super-polarity/commitdiff
Move some files around, relink
authorBen Beltran <redacted>
Sat, 31 May 2014 16:24:29 +0000 (11:24 -0500)
committerBen Beltran <redacted>
Sat, 31 May 2014 16:24:29 +0000 (11:24 -0500)
15 files changed:
SuperPolarity/ActorManager.cs
SuperPolarity/Actors/Actor.cs
SuperPolarity/Actors/Generators/FanGenerator.cs [new file with mode: 0644]
SuperPolarity/Actors/Generators/Generator.cs [new file with mode: 0644]
SuperPolarity/Actors/Generators/LineGenerator.cs [new file with mode: 0644]
SuperPolarity/Actors/Generators/PointGenerator.cs [new file with mode: 0644]
SuperPolarity/Actors/Generators/RingGenerator.cs [new file with mode: 0644]
SuperPolarity/Actors/Generators/WaveGenerator.cs [new file with mode: 0644]
SuperPolarity/ScoreScreen.cs
SuperPolarityMac/Actors/Generators/FanGenerator.cs [new file with mode: 0644]
SuperPolarityMac/Actors/Generators/Generator.cs [new file with mode: 0644]
SuperPolarityMac/Actors/Generators/LineGenerator.cs [new file with mode: 0644]
SuperPolarityMac/Actors/Generators/PointGenerator.cs [new file with mode: 0644]
SuperPolarityMac/Actors/Generators/RingGenerator.cs [new file with mode: 0644]
SuperPolarityMac/Actors/Generators/WaveGenerator.cs [new file with mode: 0644]

index f5587b9c9f772872a3915720451706b6fe3efcd8..56db26c1570603128a1d8493cd6081b900e9d7e3 100644 (file)
@@ -68,7 +68,9 @@ namespace SuperPolarity
                 {
                     Actor other = Actors[j];
 
                 {
                     Actor other = Actors[j];
 
-                    CheckCollision(actor, other);
+                                       if (actor.Collides && other.Collides) {
+                                               CheckCollision(actor, other);
+                                       }
 
                     if (actor.GetType().IsSubclassOf(typeof(Ship)) && other.GetType().IsSubclassOf(typeof(Ship)))
                     {
 
                     if (actor.GetType().IsSubclassOf(typeof(Ship)) && other.GetType().IsSubclassOf(typeof(Ship)))
                     {
index 3bb06beeedcae39694d87fb4f1e78357dddd9b9e..5e7e482781af182d63aaeefb813970bae1945dc1 100644 (file)
@@ -8,7 +8,7 @@ using Microsoft.Xna.Framework.Graphics;
 
 namespace SuperPolarity
 {
 
 namespace SuperPolarity
 {
-    class Actor
+    public class Actor
     {
         protected SuperPolarity game;
 
     {
         protected SuperPolarity game;
 
@@ -24,6 +24,7 @@ namespace SuperPolarity
 
         // Physical Properties
         public Vector2 Position;
 
         // Physical Properties
         public Vector2 Position;
+               public bool Collides;
         protected Vector2 Velocity;
         protected Vector2 Acceleration;
         public float Angle;
         protected Vector2 Velocity;
         protected Vector2 Acceleration;
         public float Angle;
@@ -64,6 +65,8 @@ namespace SuperPolarity
             Position = position;
             Active = true;
 
             Position = position;
             Active = true;
 
+                       Collides = true;
+
             Children = new List<Actor>();
 
             Origin = new Vector2(Texture.Width / 2, Texture.Height / 2);
             Children = new List<Actor>();
 
             Origin = new Vector2(Texture.Width / 2, Texture.Height / 2);
diff --git a/SuperPolarity/Actors/Generators/FanGenerator.cs b/SuperPolarity/Actors/Generators/FanGenerator.cs
new file mode 100644 (file)
index 0000000..af4bf74
--- /dev/null
@@ -0,0 +1,13 @@
+using System;
+
+namespace SuperPolarity
+{
+       public class FanGenerator : Generator
+       {
+               public FanGenerator(SuperPolarity newGame)
+                       : base(newGame)
+               {
+               }
+       }
+}
+
diff --git a/SuperPolarity/Actors/Generators/Generator.cs b/SuperPolarity/Actors/Generators/Generator.cs
new file mode 100644 (file)
index 0000000..dfbc40b
--- /dev/null
@@ -0,0 +1,14 @@
+using System;
+
+namespace SuperPolarity
+{
+       public class Generator : Actor
+       {
+               public Generator(SuperPolarity newGame)
+                       : base(newGame)
+               {
+                       Collides = false;
+               }
+       }
+}
+
diff --git a/SuperPolarity/Actors/Generators/LineGenerator.cs b/SuperPolarity/Actors/Generators/LineGenerator.cs
new file mode 100644 (file)
index 0000000..abbafa9
--- /dev/null
@@ -0,0 +1,13 @@
+using System;
+
+namespace SuperPolarity
+{
+       public class LineGenerator : Generator
+       {
+               public LineGenerator(SuperPolarity newGame)
+                       : base(newGame)
+               {
+               }
+       }
+}
+
diff --git a/SuperPolarity/Actors/Generators/PointGenerator.cs b/SuperPolarity/Actors/Generators/PointGenerator.cs
new file mode 100644 (file)
index 0000000..a753480
--- /dev/null
@@ -0,0 +1,13 @@
+using System;
+
+namespace SuperPolarity
+{
+       public class PointGenerator : Generator
+       {
+               public PointGenerator(SuperPolarity newGame)
+                       : base(newGame)
+               {
+               }
+       }
+}
+
diff --git a/SuperPolarity/Actors/Generators/RingGenerator.cs b/SuperPolarity/Actors/Generators/RingGenerator.cs
new file mode 100644 (file)
index 0000000..81c957d
--- /dev/null
@@ -0,0 +1,13 @@
+using System;
+
+namespace SuperPolarity
+{
+       public class RingGenerator : Generator
+       {
+               public RingGenerator(SuperPolarity newGame)
+                       : base(newGame)
+               {
+               }
+       }
+}
+
diff --git a/SuperPolarity/Actors/Generators/WaveGenerator.cs b/SuperPolarity/Actors/Generators/WaveGenerator.cs
new file mode 100644 (file)
index 0000000..8f1bf18
--- /dev/null
@@ -0,0 +1,13 @@
+using System;
+
+namespace SuperPolarity
+{
+       public class WaveGenerator : Generator
+       {
+               public WaveGenerator(SuperPolarity newGame)
+                       : base(newGame)
+               {
+               }
+       }
+}
+
index bf432752b1eed1563ed3027e2fde76cb21e19ce3..d879db9e2fd6918db308d0096fb94bafda2a1996 100644 (file)
@@ -13,7 +13,7 @@ namespace SuperPolarity
     {
         protected SpriteFont Font;
         protected NameChooserWidget nameChooser;
     {
         protected SpriteFont Font;
         protected NameChooserWidget nameChooser;
-        protected Dictionary<string, int> Scores;
+        protected List<Tuple<String, int>> Scores;
 
         public ScoreScreen(SuperPolarity newGame) : base(newGame) { }
 
 
         public ScoreScreen(SuperPolarity newGame) : base(newGame) { }
 
@@ -23,7 +23,7 @@ namespace SuperPolarity
             nameChooser = new NameChooserWidget(Game, new Vector2(40, Game.GraphicsDevice.Viewport.Height / 4));
             InputController.RegisterEventForButton("OK", Buttons.A);
             InputController.RegisterEventForKey("OK", Keys.Z);
             nameChooser = new NameChooserWidget(Game, new Vector2(40, Game.GraphicsDevice.Viewport.Height / 4));
             InputController.RegisterEventForButton("OK", Buttons.A);
             InputController.RegisterEventForKey("OK", Keys.Z);
-            Scores = new Dictionary<string, int>();
+                       Scores = new List<Tuple<String, int>>();
             ReadScore();
         }
 
             ReadScore();
         }
 
@@ -59,7 +59,8 @@ namespace SuperPolarity
                     while ((line = sreader.ReadLine()) != null)
                     {
                         string[] parts = line.Split(',');
                     while ((line = sreader.ReadLine()) != null)
                     {
                         string[] parts = line.Split(',');
-                        Scores.Add(parts[0], int.Parse(parts[1]));
+                                               var scoreTuple = new Tuple<String, int>(parts[0], int.Parse(parts[1]));
+                                               Scores.Add (scoreTuple);
                     }
                 }
             }
                     }
                 }
             }
@@ -92,15 +93,15 @@ namespace SuperPolarity
 
         protected void DrawScores(SpriteBatch spriteBatch)
         {
 
         protected void DrawScores(SpriteBatch spriteBatch)
         {
-            var sortedDict = (from entry in Scores orderby entry.Value descending select entry)
-                .Take(5)
-                .ToDictionary(pair => pair.Key, pair => pair.Value);
+                       var sortedList = (from entry in Scores orderby entry.Item2 descending select entry)
+                .Take (5)
+                               .ToList ();
 
             var i = 0;
 
 
             var i = 0;
 
-            foreach (KeyValuePair<string, int> entry in sortedDict) {
+            foreach (Tuple<string, int> entry in sortedList) {
                 i++;
                 i++;
-                spriteBatch.DrawString(Font, entry.Key + " " + entry.Value, new Vector2(40, Game.GraphicsDevice.Viewport.Height / 2 + 100 + (32 * i)), new Color(0, 0, 0, 64));
+                spriteBatch.DrawString(Font, entry.Item1 + " " + entry.Item2, new Vector2(40, Game.GraphicsDevice.Viewport.Height / 2 + 100 + (32 * i)), new Color(0, 0, 0, 64));
             }
 
         }
             }
 
         }
diff --git a/SuperPolarityMac/Actors/Generators/FanGenerator.cs b/SuperPolarityMac/Actors/Generators/FanGenerator.cs
new file mode 100644 (file)
index 0000000..ea080a7
--- /dev/null
@@ -0,0 +1,12 @@
+using System;
+
+namespace SuperPolarityMac
+{
+       public class FanGenerator
+       {
+               public FanGenerator ()
+               {
+               }
+       }
+}
+
diff --git a/SuperPolarityMac/Actors/Generators/Generator.cs b/SuperPolarityMac/Actors/Generators/Generator.cs
new file mode 100644 (file)
index 0000000..ce8538a
--- /dev/null
@@ -0,0 +1,12 @@
+using System;
+
+namespace SuperPolarityMac
+{
+       public class Generator
+       {
+               public Generator ()
+               {
+               }
+       }
+}
+
diff --git a/SuperPolarityMac/Actors/Generators/LineGenerator.cs b/SuperPolarityMac/Actors/Generators/LineGenerator.cs
new file mode 100644 (file)
index 0000000..b7250cb
--- /dev/null
@@ -0,0 +1,12 @@
+using System;
+
+namespace SuperPolarityMac
+{
+       public class LineGenerator
+       {
+               public LineGenerator ()
+               {
+               }
+       }
+}
+
diff --git a/SuperPolarityMac/Actors/Generators/PointGenerator.cs b/SuperPolarityMac/Actors/Generators/PointGenerator.cs
new file mode 100644 (file)
index 0000000..16a6e36
--- /dev/null
@@ -0,0 +1,12 @@
+using System;
+
+namespace SuperPolarityMac
+{
+       public class PointGenerator
+       {
+               public PointGenerator ()
+               {
+               }
+       }
+}
+
diff --git a/SuperPolarityMac/Actors/Generators/RingGenerator.cs b/SuperPolarityMac/Actors/Generators/RingGenerator.cs
new file mode 100644 (file)
index 0000000..fe0ab26
--- /dev/null
@@ -0,0 +1,12 @@
+using System;
+
+namespace SuperPolarityMac
+{
+       public class RingGenerator
+       {
+               public RingGenerator ()
+               {
+               }
+       }
+}
+
diff --git a/SuperPolarityMac/Actors/Generators/WaveGenerator.cs b/SuperPolarityMac/Actors/Generators/WaveGenerator.cs
new file mode 100644 (file)
index 0000000..8249bb0
--- /dev/null
@@ -0,0 +1,12 @@
+using System;
+
+namespace SuperPolarityMac
+{
+       public class WaveGenerator
+       {
+               public WaveGenerator ()
+               {
+               }
+       }
+}
+