From: Ben Beltran Date: Sat, 31 May 2014 16:24:29 +0000 (-0500) Subject: Move some files around, relink X-Git-Url: https://git.r.bdr.sh/rbdr/super-polarity/commitdiff_plain/8bdfcb11a2c1023c684093c0f19f3cc65799e0f8?ds=sidebyside Move some files around, relink --- diff --git a/SuperPolarity/ActorManager.cs b/SuperPolarity/ActorManager.cs index f5587b9..56db26c 100644 --- a/SuperPolarity/ActorManager.cs +++ b/SuperPolarity/ActorManager.cs @@ -68,7 +68,9 @@ namespace SuperPolarity { 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))) { diff --git a/SuperPolarity/Actors/Actor.cs b/SuperPolarity/Actors/Actor.cs index 3bb06be..5e7e482 100644 --- a/SuperPolarity/Actors/Actor.cs +++ b/SuperPolarity/Actors/Actor.cs @@ -8,7 +8,7 @@ using Microsoft.Xna.Framework.Graphics; namespace SuperPolarity { - class Actor + public class Actor { protected SuperPolarity game; @@ -24,6 +24,7 @@ namespace SuperPolarity // Physical Properties public Vector2 Position; + public bool Collides; protected Vector2 Velocity; protected Vector2 Acceleration; public float Angle; @@ -64,6 +65,8 @@ namespace SuperPolarity Position = position; Active = true; + Collides = true; + Children = new List(); 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 index 0000000..af4bf74 --- /dev/null +++ b/SuperPolarity/Actors/Generators/FanGenerator.cs @@ -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 index 0000000..dfbc40b --- /dev/null +++ b/SuperPolarity/Actors/Generators/Generator.cs @@ -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 index 0000000..abbafa9 --- /dev/null +++ b/SuperPolarity/Actors/Generators/LineGenerator.cs @@ -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 index 0000000..a753480 --- /dev/null +++ b/SuperPolarity/Actors/Generators/PointGenerator.cs @@ -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 index 0000000..81c957d --- /dev/null +++ b/SuperPolarity/Actors/Generators/RingGenerator.cs @@ -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 index 0000000..8f1bf18 --- /dev/null +++ b/SuperPolarity/Actors/Generators/WaveGenerator.cs @@ -0,0 +1,13 @@ +using System; + +namespace SuperPolarity +{ + public class WaveGenerator : Generator + { + public WaveGenerator(SuperPolarity newGame) + : base(newGame) + { + } + } +} + diff --git a/SuperPolarity/ScoreScreen.cs b/SuperPolarity/ScoreScreen.cs index bf43275..d879db9 100644 --- a/SuperPolarity/ScoreScreen.cs +++ b/SuperPolarity/ScoreScreen.cs @@ -13,7 +13,7 @@ namespace SuperPolarity { protected SpriteFont Font; protected NameChooserWidget nameChooser; - protected Dictionary Scores; + protected List> Scores; 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); - Scores = new Dictionary(); + Scores = new List>(); ReadScore(); } @@ -59,7 +59,8 @@ namespace SuperPolarity while ((line = sreader.ReadLine()) != null) { string[] parts = line.Split(','); - Scores.Add(parts[0], int.Parse(parts[1])); + var scoreTuple = new Tuple(parts[0], int.Parse(parts[1])); + Scores.Add (scoreTuple); } } } @@ -92,15 +93,15 @@ namespace SuperPolarity 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; - foreach (KeyValuePair entry in sortedDict) { + foreach (Tuple entry in sortedList) { 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 index 0000000..ea080a7 --- /dev/null +++ b/SuperPolarityMac/Actors/Generators/FanGenerator.cs @@ -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 index 0000000..ce8538a --- /dev/null +++ b/SuperPolarityMac/Actors/Generators/Generator.cs @@ -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 index 0000000..b7250cb --- /dev/null +++ b/SuperPolarityMac/Actors/Generators/LineGenerator.cs @@ -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 index 0000000..16a6e36 --- /dev/null +++ b/SuperPolarityMac/Actors/Generators/PointGenerator.cs @@ -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 index 0000000..fe0ab26 --- /dev/null +++ b/SuperPolarityMac/Actors/Generators/RingGenerator.cs @@ -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 index 0000000..8249bb0 --- /dev/null +++ b/SuperPolarityMac/Actors/Generators/WaveGenerator.cs @@ -0,0 +1,12 @@ +using System; + +namespace SuperPolarityMac +{ + public class WaveGenerator + { + public WaveGenerator () + { + } + } +} +