<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>
public List<Actor> Children;
- // Graphics / In-Game
- protected Texture2D Texture;
- protected Vector2 Origin;
+ // In-Game Properties
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;
// Constraints / Behavior
public float MaxVelocity;
- protected float AccelerationRate;
- public int HP;
- protected bool Immortal;
+ protected float AccelerationRate;
public bool Dying;
- public int Value;
- protected Color Color;
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;
- 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;
- Collides = true;
+ Collides = false;
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;
- HP = 1;
- Immortal = 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;
}
- 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)
{
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);
- var maxVelocity = MaxVelocity;
-
Velocity.X = Velocity.X + Acceleration.X * (float)gameTime.ElapsedGameTime.TotalSeconds;
Velocity.Y = Velocity.Y + Acceleration.Y * (float)gameTime.ElapsedGameTime.TotalSeconds;
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()
{
}
- public void TakeDamage(int amount)
- {
- if (!Immortal)
- {
- HP = HP - amount;
- if (HP < 0)
- {
- Die();
- }
- }
- }
-
protected virtual void Die()
{
Dying = true;
public virtual void CleanUp()
{
- Texture = null;
- BoxTexture = null;
- Children = null;
- Texture = null;
+ BoxTexture = null;
+ Children = null;
}
}
}
namespace SuperPolarity
{
- class Bullet : Actor
+ class Bullet : GameActor
{
protected ParticleEngine particleEngine;
public int Power;
--- /dev/null
+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();
+ }
+ }
+ }
+ }
+}
{
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));
+ }
}
}
{
particleEngine.Draw(spriteBatch);
base.Draw(spriteBatch);
+ spriteBatch.Draw(BoxTexture, Box, new Color(255, 0, 255, 25));
}
public override void Collide(Actor other, Rectangle collision)
{
- if (other.GetType().IsAssignableFrom(typeof(StandardShip)) &&
+ if (other.GetType().IsAssignableFrom(typeof(StandardShip)) &&
!Immortal)
{
Die();
namespace SuperPolarity
{
- class Ship : Actor
+ class Ship : GameActor
{
public enum Polarity : byte { Negative, Positive, Neutral };
+++ /dev/null
-using System;
-
-namespace SuperPolarityMac
-{
- public class FanGenerator
- {
- public FanGenerator ()
- {
- }
- }
-}
-
+++ /dev/null
-using System;
-
-namespace SuperPolarityMac
-{
- public class Generator
- {
- public Generator ()
- {
- }
- }
-}
-
+++ /dev/null
-using System;
-
-namespace SuperPolarityMac
-{
- public class LineGenerator
- {
- public LineGenerator ()
- {
- }
- }
-}
-
+++ /dev/null
-using System;
-
-namespace SuperPolarityMac
-{
- public class PointGenerator
- {
- public PointGenerator ()
- {
- }
- }
-}
-
+++ /dev/null
-using System;
-
-namespace SuperPolarityMac
-{
- public class RingGenerator
- {
- public RingGenerator ()
- {
- }
- }
-}
-
+++ /dev/null
-using System;
-
-namespace SuperPolarityMac
-{
- public class WaveGenerator
- {
- public WaveGenerator ()
- {
- }
- }
-}
-
<RootNamespace>SuperPolarityMac</RootNamespace>
<MonoMacResourcePrefix>Resources</MonoMacResourcePrefix>
<AssemblyName>SuperPolarityMac</AssemblyName>
+ <SuppressXamMacUpsell>True</SuppressXamMacUpsell>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<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">
<Folder Include="Properties\" />
<Folder Include="Content\Sound\" />
<Folder Include="Vendor\" />
+ <Folder Include="Actors\Generators\" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="..\SuperPolarity\Content\Graphics\circle.xnb">
-<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.Workbench ActiveDocument="../SuperPolarity/SuperPolarity.cs">
+ <MonoDevelop.Ide.Workbench ActiveDocument="Actors/Generators/RingGenerator.cs">
<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>