Commits

Michael Gough committed d2d051b

Fleshed out the GraphicScene and drawing side of things. The program now
draws and animates moons orbiting planets orbiting a sun.

  • Participants
  • Parent commits f5d4ac4

Comments (0)

Files changed (32)

File GameProgram/GameProgram/ClassDiagram1.cd

   <Class Name="GameProgram.Game1" Collapsed="true">
     <Position X="0.5" Y="0.5" Width="1.5" />
     <TypeIdentifier>
-      <HashCode>AAQAEEAAAAAAAwAAAAAAAAAAAAAAAAgAAAAAAAAAAAQ=</HashCode>
+      <HashCode>AAQAEEAAAAAAQwAAAAAAAAAAAABAAAgAAAAAAAAAAAQ=</HashCode>
       <FileName>Game1.cs</FileName>
     </TypeIdentifier>
   </Class>
       <FileName>Program.cs</FileName>
     </TypeIdentifier>
   </Class>
-  <Class Name="GameProgram.World">
-    <Position X="4" Y="1.25" Width="1.5" />
+  <Class Name="GameProgram.World" Collapsed="true">
+    <Position X="3.5" Y="1.5" Width="2.5" />
+    <InheritanceLine Type="GameProgram.GameEntity" FixedToPoint="true">
+      <Path>
+        <Point X="8" Y="3.25" />
+        <Point X="8" Y="3.01" />
+        <Point X="5.625" Y="3.01" />
+        <Point X="5.625" Y="2.191" />
+      </Path>
+    </InheritanceLine>
+    <AssociationLine Name="Party" Type="GameProgram.Party" FixedFromPoint="true" FixedToPoint="true">
+      <Path>
+        <Point X="3.75" Y="2.191" />
+        <Point X="3.75" Y="3.365" />
+        <Point X="3" Y="3.365" />
+      </Path>
+    </AssociationLine>
     <TypeIdentifier>
-      <HashCode>AEAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAggAAA=</HashCode>
+      <HashCode>AEAAAAAAAAAAAAAAAQAAAAAAAAEAAQAAAAEAAAgkAAA=</HashCode>
       <FileName>World.cs</FileName>
     </TypeIdentifier>
     <ShowAsAssociation>
       <Property Name="Party" />
     </ShowAsAssociation>
   </Class>
-  <Class Name="GameProgram.Party">
+  <Class Name="GameProgram.Party" Collapsed="true">
     <Position X="1.5" Y="3" Width="1.5" />
+    <AssociationLine Name="Entity" Type="GameProgram.PartyGameEntity" FixedFromPoint="true">
+      <Path>
+        <Point X="1.938" Y="3.691" />
+        <Point X="1.938" Y="4.75" />
+      </Path>
+    </AssociationLine>
     <TypeIdentifier>
-      <HashCode>EAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAE=</HashCode>
+      <HashCode>EAAAAAAAAAAAAAAAAQAgAAAAAAAAAAAAAAAAAAAEAAE=</HashCode>
       <FileName>Party.cs</FileName>
     </TypeIdentifier>
     <ShowAsAssociation>
       <Property Name="Entity" />
     </ShowAsAssociation>
   </Class>
-  <Class Name="GameProgram.StarSystem">
-    <Position X="5.25" Y="3.5" Width="1.5" />
+  <Class Name="GameProgram.StarSystem" Collapsed="true">
+    <Position X="4.5" Y="4" Width="1.5" />
     <TypeIdentifier>
-      <HashCode>QAAAAAAAAACAAAAAAAMAAAAAAAAAAAAAgAAAAAAAAAA=</HashCode>
+      <HashCode>QAAAAAAAAACAAAAAAQMAAAAAAACAAAAAgAAAAAAEAAA=</HashCode>
       <FileName>StarSystem.cs</FileName>
     </TypeIdentifier>
     <ShowAsAssociation>
       <Property Name="PlanetarySystem" />
     </ShowAsAssociation>
   </Class>
-  <Class Name="GameProgram.Entity">
-    <Position X="1.5" Y="5.25" Width="1.5" />
+  <Class Name="GameProgram.PartyGameEntity">
+    <Position X="1.5" Y="4.75" Width="1.5" />
     <TypeIdentifier>
       <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
       <FileName>Entity.cs</FileName>
     </TypeIdentifier>
   </Class>
   <Class Name="GameProgram.Star">
-    <Position X="4.25" Y="5.5" Width="1.5" />
+    <Position X="4.5" Y="5.5" Width="1.5" />
     <TypeIdentifier>
-      <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
+      <HashCode>AAAAAAAAAAAAAgAAEQAAAAAAAAAAAAAAAAEAAAAEAEA=</HashCode>
       <FileName>Star.cs</FileName>
     </TypeIdentifier>
   </Class>
-  <Class Name="GameProgram.PlanetarySystem">
-    <Position X="7.25" Y="4.75" Width="1.5" />
+  <Class Name="GameProgram.PlanetarySystem" Collapsed="true">
+    <Position X="6.5" Y="5" Width="1.5" />
+    <InheritanceLine Type="GameProgram.GameEntity" ManuallyRouted="true">
+      <Path>
+        <Point X="8" Y="4.546" />
+        <Point X="8" Y="4.847" />
+        <Point X="7.25" Y="4.847" />
+        <Point X="7.25" Y="5" />
+      </Path>
+    </InheritanceLine>
     <TypeIdentifier>
-      <HashCode>AAAAAAAAAAEAAAAAAAAAAAAAACAAAggAAAIAAAAAAAA=</HashCode>
+      <HashCode>AAAAQAACAAEAAAAAEQAAAAAAACAAAggAAAMAACAEAEA=</HashCode>
       <FileName>PlanetarySystem.cs</FileName>
     </TypeIdentifier>
     <ShowAsAssociation>
       <Property Name="Planet" />
       <Property Name="Moon" />
     </ShowAsAssociation>
+    <Lollipop Orientation="Right" Position="0.343" />
   </Class>
   <Class Name="GameProgram.Unit">
     <Position X="0.5" Y="6.75" Width="1.5" />
     </TypeIdentifier>
   </Class>
   <Class Name="GameProgram.StationaryEntity">
-    <Position X="3" Y="6.75" Width="1.5" />
+    <Position X="2.75" Y="6.75" Width="1.5" />
     <TypeIdentifier>
       <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
       <FileName>StationaryEntity.cs</FileName>
     </TypeIdentifier>
   </Class>
-  <Class Name="GameProgram.Planet">
-    <Position X="6" Y="6.75" Width="1.5" />
+  <Class Name="GameProgram.Planet" Collapsed="true">
+    <Position X="6.5" Y="6.75" Width="1.5" />
     <TypeIdentifier>
       <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
       <FileName>Planet.cs</FileName>
     </TypeIdentifier>
   </Class>
-  <Class Name="GameProgram.Moon">
-    <Position X="8.25" Y="6.75" Width="1.5" />
+  <Class Name="GameProgram.Moon" Collapsed="true">
+    <Position X="8.75" Y="6.5" Width="1.5" />
     <TypeIdentifier>
       <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
       <FileName>Moon.cs</FileName>
     </TypeIdentifier>
   </Class>
-  <Class Name="GameProgram.Geoid">
-    <Position X="8.25" Y="8.25" Width="1.5" />
+  <Class Name="GameProgram.Geoid" Collapsed="true">
+    <Position X="8.25" Y="8.25" Width="2.75" />
     <TypeIdentifier>
-      <HashCode>AEAAAAAACAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAA=</HashCode>
+      <HashCode>AEAAQAAiCAAAAAAQhQAAAAAAAAAAAAAEAAAAACAEAEA=</HashCode>
       <FileName>Geoid.cs</FileName>
     </TypeIdentifier>
   </Class>
       <FileName>Structure.cs</FileName>
     </TypeIdentifier>
   </Class>
-  <Class Name="GameProgram.Region">
-    <Position X="4.25" Y="8.5" Width="1.5" />
+  <Class Name="GameProgram.Region" Collapsed="true">
+    <Position X="3.75" Y="8.5" Width="1.5" />
     <TypeIdentifier>
       <HashCode>AAAAAAAACAAAAAAAAAAAAAAIAAAAAAAAAAAAACJAAAA=</HashCode>
       <FileName>Region.cs</FileName>
       <Property Name="Sector" />
     </ShowAsAssociation>
   </Class>
-  <Class Name="GameProgram.GeoidalSector">
+  <Class Name="GameProgram.GeoidalSector" Collapsed="true">
     <Position X="6.25" Y="8.5" Width="1.5" />
+    <InheritanceLine Type="GameProgram.VisableGameEntity" FixedFromPoint="true" FixedToPoint="true">
+      <Path>
+        <Point X="11.312" Y="5.941" />
+        <Point X="11.312" Y="9.566" />
+        <Point X="7.5" Y="9.566" />
+        <Point X="7.5" Y="9.191" />
+      </Path>
+    </InheritanceLine>
     <TypeIdentifier>
-      <HashCode>AgAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
-      <FileName>Sector.cs</FileName>
+      <HashCode>AgAAAAAAAAAAAAAAAQAAQAAAAAAAAAAAAAAAAAIEAEA=</HashCode>
+      <FileName>GeoidalSector.cs</FileName>
     </TypeIdentifier>
     <ShowAsAssociation>
       <Property Name="Geoid" />
       <FileName>RegionFactory.cs</FileName>
     </TypeIdentifier>
   </Class>
-  <Class Name="GameProgram.SectorFactory" Collapsed="true">
+  <Class Name="GameProgram.GeoidalSectorFactory" Collapsed="true">
     <Position X="10.5" Y="1.5" Width="1.5" />
     <TypeIdentifier>
       <HashCode>AAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
     </TypeIdentifier>
   </Class>
   <Class Name="GameProgram.StarSystemFactory" Collapsed="true">
-    <Position X="7" Y="2.5" Width="1.5" />
+    <Position X="7" Y="2.25" Width="1.5" />
     <TypeIdentifier>
-      <HashCode>AAAAAAAAAAAAAAAAAEEAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
+      <HashCode>AAAAAAAAAAAAAAAAAEEAAAACAAAAAAAAAAAAAAAAAAA=</HashCode>
       <FileName>StarSystemFactory.cs</FileName>
     </TypeIdentifier>
   </Class>
   <Class Name="GameProgram.WorldFactory" Collapsed="true">
-    <Position X="8.75" Y="2.5" Width="1.5" />
+    <Position X="8.75" Y="2.25" Width="1.5" />
     <TypeIdentifier>
       <HashCode>AAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAIAAA=</HashCode>
       <FileName>WorldFactory.cs</FileName>
     </TypeIdentifier>
   </Class>
+  <Class Name="GameProgram.GraphicsItem">
+    <Position X="12.25" Y="4.75" Width="1.5" />
+    <TypeIdentifier>
+      <HashCode>AAAABAAAAAAgAAAAAAIAAAAAAAgAAgAAAAAAAAAAAAA=</HashCode>
+      <FileName>GraphicsItem.cs</FileName>
+    </TypeIdentifier>
+    <ShowAsAssociation>
+      <Property Name="VisableGameEntity" />
+    </ShowAsAssociation>
+    <Lollipop Orientation="Right" Position="0.103" />
+  </Class>
+  <Class Name="GameProgram.GameEntity">
+    <Position X="7" Y="3.25" Width="2" />
+    <TypeIdentifier>
+      <HashCode>AAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAEAAA=</HashCode>
+      <FileName>GameEntity.cs</FileName>
+    </TypeIdentifier>
+    <Lollipop Position="0.2" />
+  </Class>
+  <Class Name="GameProgram.GraphicsScene">
+    <Position X="12.25" Y="3.25" Width="1.5" />
+    <AssociationLine Name="GraphicsItem" Type="GameProgram.GraphicsItem">
+      <MemberNameLabel ManuallyPlaced="true">
+        <Position X="0.213" Y="0.12" />
+      </MemberNameLabel>
+    </AssociationLine>
+    <TypeIdentifier>
+      <HashCode>AAIABEAAAAAAAAAAAAIAIAAABAAAAAAAAAAAAAAAAAA=</HashCode>
+      <FileName>GraphicsScene.cs</FileName>
+    </TypeIdentifier>
+    <ShowAsAssociation>
+      <Property Name="GraphicsItem" />
+    </ShowAsAssociation>
+    <Lollipop Position="0.2" />
+  </Class>
+  <Class Name="GameProgram.VisableGameEntity" Collapsed="true">
+    <Position X="9.25" Y="5.25" Width="2.25" />
+    <InheritanceLine Type="GameProgram.GameEntity" ManuallyRouted="true">
+      <Path>
+        <Point X="8" Y="4.546" />
+        <Point X="8" Y="4.814" />
+        <Point X="10.375" Y="4.814" />
+        <Point X="10.375" Y="5.25" />
+      </Path>
+    </InheritanceLine>
+    <TypeIdentifier>
+      <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEA=</HashCode>
+      <FileName>VisibleGameEntity.cs</FileName>
+    </TypeIdentifier>
+    <Lollipop Position="0.2" />
+  </Class>
+  <Class Name="GameProgram.GraphicsSceneFactory">
+    <Position X="13.25" Y="0.75" Width="1.5" />
+    <TypeIdentifier>
+      <HashCode>AIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAA=</HashCode>
+      <FileName>GraphicsSceneFactory.cs</FileName>
+    </TypeIdentifier>
+  </Class>
+  <Class Name="GameProgram.GraphicsItemFactory">
+    <Position X="15" Y="2.25" Width="2.25" />
+    <TypeIdentifier>
+      <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAA=</HashCode>
+      <FileName>GraphicsItemFactory.cs</FileName>
+    </TypeIdentifier>
+  </Class>
+  <Interface Name="GameProgram.Location">
+    <Position X="9.75" Y="3.25" Width="2" />
+    <TypeIdentifier>
+      <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEA=</HashCode>
+      <FileName>Visible.cs</FileName>
+    </TypeIdentifier>
+  </Interface>
+  <Interface Name="GameProgram.Loading">
+    <Position X="14.5" Y="4" Width="1.5" />
+    <TypeIdentifier>
+      <HashCode>AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
+      <FileName>Loading.cs</FileName>
+    </TypeIdentifier>
+  </Interface>
+  <Interface Name="GameProgram.Update">
+    <Position X="5.25" Y="0.5" Width="1.5" />
+    <TypeIdentifier>
+      <HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAA=</HashCode>
+      <FileName>Update.cs</FileName>
+    </TypeIdentifier>
+  </Interface>
+  <Interface Name="GameProgram.Draw">
+    <Position X="14.75" Y="5.75" Width="1.5" />
+    <TypeIdentifier>
+      <HashCode>AAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
+      <FileName>Draw.cs</FileName>
+    </TypeIdentifier>
+  </Interface>
   <Font Name="Segoe UI" Size="9" />
 </ClassDiagram>

File GameProgram/GameProgram/Draw.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace GameProgram
+{
+  public interface Draw
+  {
+    void draw( SpriteBatch spriteBatch );
+  }
+}

File GameProgram/GameProgram/Entity.cs

 
 namespace GameProgram
 {
-  public class Entity
+  public abstract class PartyGameEntity
   {
   }
 }

File GameProgram/GameProgram/Game1.cs

 
 namespace GameProgram
 {
-    /// <summary>
+  /// <summary>
   /// This is the main type for your game
   /// </summary>
   public class Game1 : Microsoft.Xna.Framework.Game
   {
     GraphicsDeviceManager graphics;
     SpriteBatch spriteBatch;
+    
+    private World world;
+    private GraphicsScene graphicsScene;
+
+    //// This is a texture we can render.
+    //Texture2D myTexture;
+
+    //// Set the coordinates to draw the sprite at.
+    //Vector2 spritePosition = Vector2.Zero;
+
+    //// Store some information about the sprite's motion.
+    //Vector2 spriteSpeed = new Vector2( 50.0f, 50.0f );
 
     public Game1()
     {
       graphics = new GraphicsDeviceManager( this );
       Content.RootDirectory = "Content";
+
+      graphics.PreferredBackBufferWidth = 1024;
+      graphics.PreferredBackBufferWidth = 800;
+      graphics.ApplyChanges();
+      //graphics.IsFullScreen = true;
+
+      this.Window.AllowUserResizing = true;
     }
 
     /// <summary>
       // TODO: Add your initialization logic here
 
       WorldFactory worldFactory = new WorldFactory();
-      world = worldFactory.createWorld();
-
+      GraphicsSceneFactory graphicsSceneFactory = new GraphicsSceneFactory();
+    
+      world         = worldFactory.createWorld();
+      graphicsScene = graphicsSceneFactory.createGraphicsScene( spriteBatch, world.getVisableGameEntities() );
+      
       base.Initialize();
     }
 
       // Create a new SpriteBatch, which can be used to draw textures.
       spriteBatch = new SpriteBatch( GraphicsDevice );
       
-
-
       // TODO: use this.Content to load your game content here
+      graphicsScene.loadContent( this );
+      //myTexture = Content.Load<Texture2D>( "WhiteCircle" );
     }
 
     /// <summary>
       if (GamePad.GetState( PlayerIndex.One ).Buttons.Back == ButtonState.Pressed)
         this.Exit();
 
-      // TODO: Add your update logic here
+      world.update( gameTime );
+
+      //// TODO: Add your update logic here
+      //// Move the sprite by speed, scaled by elapsed time.
+      //spritePosition +=
+      //    spriteSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
+
+      //int MaxX =
+      //    graphics.GraphicsDevice.Viewport.Width - myTexture.Width;
+      //int MinX = 0;
+      //int MaxY =
+      //    graphics.GraphicsDevice.Viewport.Height - myTexture.Height;
+      //int MinY = 0;
+
+      //// Check for bounce.
+      //if (spritePosition.X > MaxX)
+      //{
+      //  spriteSpeed.X *= -1;
+      //  spritePosition.X = MaxX;
+      //}
+
+      //else if (spritePosition.X < MinX)
+      //{
+      //  spriteSpeed.X *= -1;
+      //  spritePosition.X = MinX;
+      //}
+
+      //if (spritePosition.Y > MaxY)
+      //{
+      //  spriteSpeed.Y *= -1;
+      //  spritePosition.Y = MaxY;
+      //}
+
+      //else if (spritePosition.Y < MinY)
+      //{
+      //  spriteSpeed.Y *= -1;
+      //  spritePosition.Y = MinY;
+      //}
 
       base.Update( gameTime );
     }
     /// <param name="gameTime">Provides a snapshot of timing values.</param>
     protected override void Draw( GameTime gameTime )
     {
-      GraphicsDevice.Clear( Color.CornflowerBlue );
+      GraphicsDevice.Clear( Color.Black );
 
       // TODO: Add your drawing code here
+      spriteBatch.Begin( SpriteSortMode.BackToFront, BlendState.AlphaBlend );
+      graphicsScene.draw( spriteBatch );
+      //spriteBatch.Draw( myTexture, spritePosition, Color.White );
+      spriteBatch.End();
 
       base.Draw( gameTime );
     }
 
-    private World world;
   }
 }

File GameProgram/GameProgram/GameEntity.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+
+namespace GameProgram
+{
+  public abstract class GameEntity : Update
+  {
+    public abstract List<VisableGameEntity> getChildVisableGameEntities();
+    //{
+    //  List<VisableGameEntity> currentVisableGameEntityList = new List<VisableGameEntity>();
+
+    //  return getChildVisableGameEntities( currentVisableGameEntityList );
+    //}
+
+    //public abstract List<VisableGameEntity> getChildVisableGameEntities();
+
+    //public abstract List<VisableGameEntity> getChildVisableGameEntities( List<VisableGameEntity> currentVisableGameEntityList );
+    //{
+    //  return currentVisableGameEntityList;
+    //}
+
+    public abstract void update( GameTime gameTime);
+
+  }
+}

File GameProgram/GameProgram/GameProgram.csproj

     <Reference Include="System.Net" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Draw.cs" />
     <Compile Include="Entity.cs" />
+    <Compile Include="GameEntity.cs" />
     <Compile Include="Geoid.cs" />
+    <Compile Include="GraphicsScene.cs" />
+    <Compile Include="GraphicsItem.cs" />
+    <Compile Include="GraphicsItemFactory.cs" />
+    <Compile Include="GraphicsSceneFactory.cs" />
     <Compile Include="GroundStructure.cs" />
+    <Compile Include="Loading.cs" />
+    <Compile Include="VisibleGameEntity.cs" />
     <Compile Include="Moon.cs" />
     <Compile Include="MoonFactory.cs" />
     <Compile Include="Party.cs" />
     <Compile Include="Region.cs" />
     <Compile Include="RegionFactory.cs" />
     <Compile Include="ResourceReserve.cs" />
-    <Compile Include="Sector.cs" />
+    <Compile Include="GeoidalSector.cs" />
     <Compile Include="SectorFactory.cs" />
     <Compile Include="SpaceStructure.cs" />
     <Compile Include="Star.cs" />
+    <Compile Include="StarFactory.cs" />
     <Compile Include="StarSystem.cs" />
     <Compile Include="StarSystemFactory.cs" />
     <Compile Include="StationaryEntity.cs" />
     <Compile Include="Structure.cs" />
     <Compile Include="Unit.cs" />
+    <Compile Include="Update.cs" />
+    <Compile Include="Visible.cs" />
     <Compile Include="World.cs" />
     <Compile Include="WorldFactory.cs" />
   </ItemGroup>

File GameProgram/GameProgram/Geoid.cs

 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using Microsoft.Xna.Framework;
 
 namespace GameProgram
 {
-  public class Geoid
+  public abstract class Geoid : VisableGameEntity
   {
     private List<GeoidalSector> sectors = new List<GeoidalSector>();
-    private SectorFactory sectorFactory;
+    private GeoidalSectorFactory sectorFactory = new GeoidalSectorFactory();
+    private PlanetarySystem planetarySystem;
+    protected Vector2 coordinatesWrtPlanetarySystemOrigin = Vector2.Zero;
+    protected Vector2 velocityWrtPlanetarySystemOrigin = Vector2.Zero;
+    private float parentOrbitRadius = 0.0F;
+    private float longitude = 0.0F;
+    protected float angularSpeed = ( ( 2F* 2F * (float)Math.PI ) / 60.0F );
 
-    public Geoid()
-    {
-      sectorFactory = new SectorFactory();
+    public Geoid( PlanetarySystem planetarySystem, float parentOrbitRadius, float initialLongitude )      
+    {      
+      this.planetarySystem = planetarySystem;
+      this.parentOrbitRadius = parentOrbitRadius;
+      this.longitude = initialLongitude;
 
+      coordinatesWrtPlanetarySystemOrigin.X = parentOrbitRadius * (float)Math.Cos( longitude );
+      coordinatesWrtPlanetarySystemOrigin.Y = parentOrbitRadius * (float)Math.Sin( longitude );  
     }
 
     internal void addSector( Region newRegion )
     {
       throw new NotImplementedException();
     }
+
+    public override Vector2 getAbsolutePosition()
+    {
+      return planetarySystem.getAbsolutePosition() + coordinatesWrtPlanetarySystemOrigin;
+    }
+
+    public override List<VisableGameEntity> getChildVisableGameEntities()
+    {
+      return new List<VisableGameEntity>(); 
+    }
+
+    public override void update( GameTime gameTime )
+    {
+      //float distanceTravelled = angularSpeed 
+      //                          * (float)gameTime.ElapsedGameTime.TotalSeconds
+      //                          * parentOrbitRadius;
+
+      longitude += angularSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
+
+      //coordinatesWrtStarSystemOrigin += velocityWrtStarSystemOrigin * (float)gameTime.ElapsedGameTime.TotalSeconds;
+
+      coordinatesWrtPlanetarySystemOrigin.X = parentOrbitRadius * (float)Math.Cos( longitude );
+      coordinatesWrtPlanetarySystemOrigin.Y = parentOrbitRadius * (float)Math.Sin( longitude );  
+    }
+
   }
 }

File GameProgram/GameProgram/GeoidalSector.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+
+namespace GameProgram
+{
+  public class GeoidalSector : VisableGameEntity
+  {
+    private Region newRegion;
+    private Geoid geoid;
+
+    public GeoidalSector( Region newRegion )
+    {
+      // TODO: Complete member initialization
+      this.newRegion = newRegion;
+    }
+
+    public Geoid Geoid
+    {
+      get
+      {
+        throw new System.NotImplementedException();
+      }
+      set
+      {
+        geoid = value;
+      }
+    }
+
+    public override List<VisableGameEntity> getChildVisableGameEntities()
+    {
+      return new List<VisableGameEntity>();
+    }
+
+    public override Vector2 getAbsolutePosition()
+    {
+      return geoid.getAbsolutePosition();
+    }
+
+    public override void update( GameTime gameTime )
+    {
+    }
+  }
+}

File GameProgram/GameProgram/GraphicsItem.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Content;
+using Microsoft.Xna.Framework;
+
+namespace GameProgram
+{
+  public class GraphicsItem : Loading, Draw
+  {
+    Texture2D texture;
+    VisableGameEntity visableGameEntity;
+    Vector2 cameraOffset = new Vector2( 800.0F, 600.0F);
+    Vector2 spriteOffset = Vector2.Zero;
+    float scaleFactor = 0.3F;
+
+    public VisableGameEntity VisableGameEntity
+    {
+      get
+      {
+        throw new System.NotImplementedException();
+      }
+      set
+      {
+      }
+    }
+
+    public void draw( SpriteBatch spriteBatch )
+    {
+      spriteBatch.Draw( texture, 
+                        visableGameEntity.getAbsolutePosition() + cameraOffset + spriteOffset, 
+                        null, 
+                        Color.White, 
+                        0f, 
+                        Vector2.Zero, 
+                        visableGameEntity.RelativeRadius * scaleFactor, 
+                        SpriteEffects.None, 
+                        0f );
+    }
+
+    public void loadContent( Game1 game1 )
+    {
+      texture = game1.Content.Load<Texture2D>( "WhiteCircle" );
+      spriteOffset.X = -(texture.Width/2) * visableGameEntity.RelativeRadius * scaleFactor;
+      spriteOffset.Y = -(texture.Height/2) * visableGameEntity.RelativeRadius * scaleFactor;
+    }
+
+    public GraphicsItem( VisableGameEntity visableGameEntity )
+    {
+      // TODO: Complete member initialization
+      this.visableGameEntity = visableGameEntity;
+    }
+  }
+
+}

File GameProgram/GameProgram/GraphicsItemFactory.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace GameProgram
+{
+  public class GraphicsItemFactory
+  {
+    //public void createGraphicsItem()
+    //{
+    //  throw new System.NotImplementedException();
+    //}
+
+    internal GraphicsItem createGraphicsItem( SpriteBatch spriteBatch, VisableGameEntity visableGameEntity )
+    {
+      GraphicsItem newGraphics = new GraphicsItem( visableGameEntity );
+
+      return newGraphics;
+    }
+
+  }
+}

File GameProgram/GameProgram/GraphicsScene.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace GameProgram
+{
+  public class GraphicsScene : Loading, Draw
+  {
+    private List<GraphicsItem> graphicsItems = new List<GraphicsItem>();
+    private SpriteBatch spriteBatch;
+
+    public GraphicsScene( SpriteBatch spriteBatch )
+    {
+      // TODO: Complete member initialization
+      this.spriteBatch = spriteBatch;
+    }
+
+    public GraphicsItem GraphicsItem
+    {
+      get
+      {
+        throw new System.NotImplementedException();
+      }
+      set
+      {
+      }
+    }
+
+    public void draw( SpriteBatch spriteBatch)
+    {
+      foreach( GraphicsItem graphicsItem in graphicsItems )      
+      {
+        graphicsItem.draw( spriteBatch );
+      }
+
+    }
+
+    public void loadContent( Game1 game1 )
+    {
+      foreach( GraphicsItem graphicsItem in graphicsItems ) 
+      {
+        graphicsItem.loadContent( game1 );
+      }
+    }
+
+    internal void Add( GameProgram.GraphicsItem newGraphicsItem )
+    {
+      graphicsItems.Add( newGraphicsItem );
+    }
+  }
+}

File GameProgram/GameProgram/GraphicsSceneFactory.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework.Graphics;
+
+namespace GameProgram
+{
+  public class GraphicsSceneFactory
+  {
+    private GraphicsItemFactory graphicsItemFactory = new GraphicsItemFactory();
+
+    //public GraphicsItemFactory GraphicsItemFactory
+    //{
+    //  get
+    //  {
+    //    throw new System.NotImplementedException();
+    //  }
+    //  set
+    //  {
+    //  }
+    //}
+
+    //public void createGraphicsScene()
+    //{
+    //  throw new System.NotImplementedException();
+    //}
+
+    internal GraphicsScene createGraphicsScene( SpriteBatch spriteBatch, List<VisableGameEntity> visibleGameEntities )
+    {
+      GraphicsScene newGraphicsScene = new GraphicsScene( spriteBatch );
+      GraphicsItem newGraphicsItem;
+
+      foreach( VisableGameEntity visableGameEntity in visibleGameEntities )
+      {
+        newGraphicsItem = graphicsItemFactory.createGraphicsItem( spriteBatch, visableGameEntity );
+
+        newGraphicsScene.Add( newGraphicsItem );
+        
+      }
+
+      return newGraphicsScene;
+    }
+  }
+}

File GameProgram/GameProgram/Loading.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace GameProgram
+{
+  public interface Loading
+  {
+    void loadContent( Game1 game1 );
+  }
+}

File GameProgram/GameProgram/Moon.cs

 {
   public class Moon : Geoid
   {
+    public Moon( PlanetarySystem planetarySystem, float parentOrbitRadius, float initialLongitude ) :
+      base( planetarySystem, parentOrbitRadius, initialLongitude )
+    {
+      Random randomNumber = new Random( System.DateTime.Now.Millisecond);
+
+      RelativeRadius = 0.1F;
+      angularSpeed = (randomNumber.Next(-100,100) % 40) * ( 2F * (float)Math.PI ) / 60.0F;
+     
+    }
+
   }
 }

File GameProgram/GameProgram/MoonFactory.cs

 {
   class MoonFactory
   {
-    internal Moon createMoon( Planet newPlanet )
+    internal Moon createMoon( PlanetarySystem planetarySystem, float parentOrbitRadius, float initialLongitude )
     {
-      Moon newMoon = new Moon();
+      Moon newMoon = new Moon( planetarySystem, parentOrbitRadius, initialLongitude);
 
       return newMoon;
     }

File GameProgram/GameProgram/Party.cs

 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using Microsoft.Xna.Framework;
 
 namespace GameProgram
 {
-  public class Party
+  public class Party : GameEntity
   {
     private List<Region> regions = new List<Region>();
 
       // TODO: Complete member initialization
     }
 
-    public Entity Entity
+    public PartyGameEntity Entity
     {
       get
       {
 
       regions.Add( startingRegion );
     }
+
+    public override List<VisableGameEntity> getChildVisableGameEntities()
+    {
+      return new List<VisableGameEntity>();
+    }
+
+    public override void update( GameTime gameTime )
+    {
+    }
   }
 }

File GameProgram/GameProgram/Planet.cs

 namespace GameProgram
 {
   public class Planet : Geoid
-  {
-    public Planet() :
-      base()
-    {      
-      
+  {  
+    public Planet( PlanetarySystem planetarySystem, float parentOrbitRadius, float initialLongitude ) :
+      base( planetarySystem, parentOrbitRadius, initialLongitude )
+    {
+      RelativeRadius = 0.25F;
+     
     }
 
-
   }
 }

File GameProgram/GameProgram/PlanetFactory.cs

 {
   class PlanetFactory
   {
-    internal Planet createPlanet()
+    internal Planet createPlanet( PlanetarySystem planetarySystem, float parentOrbitRadius, float initialLongitude )
     {
-      Planet newPlanet = new Planet();
+      Planet newPlanet = new Planet(  planetarySystem, parentOrbitRadius, initialLongitude);
 
       return newPlanet;
       

File GameProgram/GameProgram/PlanetarySystem.cs

 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using Microsoft.Xna.Framework;
 
 namespace GameProgram
 {
-  public class PlanetarySystem
+  public class PlanetarySystem : GameEntity, Location
   {
+    private StarSystem starSystem;
     private Planet planet;
     private List<Moon> moons = new List<Moon>();
+    private Vector2 coordinatesWrtStarSystemOrigin = Vector2.Zero;
+    //private Vector2 velocityWrtStarSystemOrigin = Vector2.Zero;
+    //private Vector2 accelerationWrtStarSystemOrigin = Vector2.Zero;
+    private float parentOrbitRadius = 0.0F;
+    private float longitude = 0.0F;
+    private float angularSpeed = ( ( 2F * (float)Math.PI ) / 60.0F );
+
+    public PlanetarySystem( StarSystem starSystem, float parentOrbitRadius, float initialLongitude )
+    {
+      this.starSystem = starSystem;
+      this.parentOrbitRadius = parentOrbitRadius;
+      this.longitude = initialLongitude;
+
+      coordinatesWrtStarSystemOrigin.X = parentOrbitRadius * (float)Math.Cos( longitude );
+      coordinatesWrtStarSystemOrigin.Y = parentOrbitRadius * (float)Math.Sin( longitude );
+
+      Random randomNumber = new Random( System.DateTime.Now.Millisecond );
+
+      angularSpeed = ( randomNumber.Next( -100, 100 ) % 4 )+1 * ( ( 2F * (float)Math.PI ) / 60.0F );
+    }
+
 
     public Planet Planet
     {
       moons.Add( newMoon );
     }
 
+
+    public Vector2 getAbsolutePosition()
+    {
+      return coordinatesWrtStarSystemOrigin;
+    }
+
+    public override List<VisableGameEntity> getChildVisableGameEntities()
+    {
+      List<VisableGameEntity> visableGameEntities = new List<VisableGameEntity>();
+
+      visableGameEntities.Add( planet );
+
+      foreach (Moon moon in moons)
+      {
+        visableGameEntities.Add( moon );
+      }
+
+      return visableGameEntities;
+    }
+
+    public override void update( GameTime gameTime )
+    {
+
+      //float distanceTravelled = angularSpeed 
+      //                          * (float)gameTime.ElapsedGameTime.TotalSeconds
+      //                          * parentOrbitRadius;
+
+      longitude += angularSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;
+
+      //coordinatesWrtStarSystemOrigin += velocityWrtStarSystemOrigin * (float)gameTime.ElapsedGameTime.TotalSeconds;
+
+      coordinatesWrtStarSystemOrigin.X = parentOrbitRadius * (float)Math.Cos( longitude );
+      coordinatesWrtStarSystemOrigin.Y = parentOrbitRadius * (float)Math.Sin( longitude );      
+
+      planet.update( gameTime );
+
+      foreach (Moon moon in moons)
+      {
+        moon.update( gameTime );
+      }
+    }
+    
   }
 }

File GameProgram/GameProgram/PlanetarySystemFactory.cs

       planetFactory = new PlanetFactory();
       moonFactory   = new MoonFactory();
     }
-    
-    internal PlanetarySystem createPlanetarySystem()
+
+    internal PlanetarySystem createPlanetarySystem( StarSystem newStarSystem, float parentOrbitalRadius, float initialLongitude )
     {
-      PlanetarySystem newPlanetarySystem = new PlanetarySystem();
+      Random randomNumber = new Random(System.DateTime.Now.Millisecond);
 
-      Planet newPlanet = planetFactory.createPlanet();
+      PlanetarySystem newPlanetarySystem = new PlanetarySystem( newStarSystem, parentOrbitalRadius, randomNumber.Next( 2 * (int)Math.PI ) );
 
-      Moon newMoon = moonFactory.createMoon( newPlanet );
+      Planet newPlanet = planetFactory.createPlanet( newPlanetarySystem, 0.0F, 0.0F );
+
+      Moon newMoon = moonFactory.createMoon( newPlanetarySystem, randomNumber.Next( 50, 75 ), randomNumber.Next( 2 * (int)Math.PI ) );
 
       newPlanetarySystem.Planet = newPlanet;
       newPlanetarySystem.addMoon( newMoon );
 
-      newMoon = moonFactory.createMoon( newPlanet );
+      newMoon = moonFactory.createMoon( newPlanetarySystem, randomNumber.Next( 100, 125 ), randomNumber.Next( 2 * (int)Math.PI ) );
 
       newPlanetarySystem.addMoon( newMoon );
 

File GameProgram/GameProgram/SectorFactory.cs

 
 namespace GameProgram
 {
-  class SectorFactory
+  class GeoidalSectorFactory
   {
     internal GeoidalSector createSector( Region newRegion )
     {

File GameProgram/GameProgram/Star.cs

 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using Microsoft.Xna.Framework;
 
 namespace GameProgram
 {
-  public class Star
+  public class Star : VisableGameEntity
   {
+    private Vector2 coordinatesWrtStarSystemOrigin = Vector2.Zero;
+    private Vector2 velocityWrtStarSystemOrigin = Vector2.Zero;
+    private StarSystem starSystem;
+
+    public Star( StarSystem starSystem )
+    {
+      this.starSystem = starSystem;
+      RelativeRadius = 1F;
+    }
+
+    public override Vector2 getAbsolutePosition()
+    {
+      return coordinatesWrtStarSystemOrigin; /* starSystem.getAbsolutePosition() +*/ 
+    }
+
+    public override List<VisableGameEntity> getChildVisableGameEntities()
+    {
+      return new List<VisableGameEntity>();
+    }
+
+    public override void update( GameTime gameTime )
+    {
+    }
+
   }
 }

File GameProgram/GameProgram/StarFactory.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace GameProgram
+{
+  class StarFactory
+  {
+    internal Star createStar( StarSystem newStarSystem )
+    {
+      Star newStar = new Star( newStarSystem );
+
+      return newStar;
+    }
+  }
+}

File GameProgram/GameProgram/StarSystem.cs

 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using Microsoft.Xna.Framework;
 
 namespace GameProgram
 {
-  public class StarSystem
+  public class StarSystem : GameEntity
   {
     private List<PlanetarySystem> planetarySystems = new List<PlanetarySystem>();
+    private Star star;
 
     public Star Star
     {
       }
       set
       {
+        star = value;
       }
     }
 
     {
       planetarySystems.Add( newPlanetarySystem );
     }
+
+    public override List<VisableGameEntity> getChildVisableGameEntities()
+    {
+      List<VisableGameEntity> visableGameEntities = new List<VisableGameEntity>();
+
+      visableGameEntities.Add( star );
+
+      foreach (PlanetarySystem planetarySystem in planetarySystems)
+      {
+        visableGameEntities.AddRange(planetarySystem.getChildVisableGameEntities());
+      }
+
+      return visableGameEntities;
+    }
+
+    public override void update( GameTime gameTime )
+    {
+      star.update( gameTime );
+
+      foreach (PlanetarySystem planetarySystem in planetarySystems)
+      {
+        planetarySystem.update( gameTime );
+      }
+    }
   }
 }

File GameProgram/GameProgram/StarSystemFactory.cs

 {
   class StarSystemFactory
   {
-    private PlanetarySystemFactory planetarySystemFactory;
+    private PlanetarySystemFactory planetarySystemFactory = new PlanetarySystemFactory();
+    private StarFactory starFactory = new StarFactory();
 
     public StarSystemFactory()
     {
-      planetarySystemFactory = new PlanetarySystemFactory();
     }
 
     internal StarSystem createStarSystem()
     {
+      Random randomNumber = new Random( System.DateTime.Now.Millisecond );
+
       StarSystem newStarSystem = new StarSystem();
-      
-      PlanetarySystem newPlanetarySystem = planetarySystemFactory.createPlanetarySystem();
 
+      Star newStar = starFactory.createStar( newStarSystem );
+      PlanetarySystem newPlanetarySystem = planetarySystemFactory.createPlanetarySystem( newStarSystem, randomNumber.Next( 150, 225 ), randomNumber.Next( 2 * (int)Math.PI ) );
+      newStarSystem.addPlanetarySystem( newPlanetarySystem );
+      newPlanetarySystem = planetarySystemFactory.createPlanetarySystem( newStarSystem, randomNumber.Next( 350, 400), randomNumber.Next( 2 * (int)Math.PI ) );
+
+      newStarSystem.Star = newStar;
       newStarSystem.addPlanetarySystem( newPlanetarySystem );
 
       return newStarSystem;

File GameProgram/GameProgram/StationaryEntity.cs

 
 namespace GameProgram
 {
-  public class StationaryEntity : Entity
+  public abstract class StationaryEntity : PartyGameEntity
   {
   }
 }

File GameProgram/GameProgram/Structure.cs

 
 namespace GameProgram
 {
-  public class Structure : StationaryEntity
+  public abstract class Structure : StationaryEntity
   {
   }
 }

File GameProgram/GameProgram/Unit.cs

 
 namespace GameProgram
 {
-  public class Unit : Entity
+  public class Unit : PartyGameEntity
   {
   }
 }

File GameProgram/GameProgram/Update.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+
+namespace GameProgram
+{
+  public interface Update
+  {
+    void update( GameTime gameTime );
+  }
+}

File GameProgram/GameProgram/Visible.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+
+namespace GameProgram
+{
+  public interface Location
+  {
+    Vector2 getAbsolutePosition();
+  }
+}

File GameProgram/GameProgram/VisibleGameEntity.cs

+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+
+namespace GameProgram
+{
+  abstract public class VisableGameEntity : GameEntity, Location
+  {
+    abstract public Vector2 getAbsolutePosition();
+
+    private float relativeRadius = 1.0F;
+
+    public float RelativeRadius
+    {
+      get { return relativeRadius; }
+      set { relativeRadius = value; }
+    }
+
+  }
+}

File GameProgram/GameProgram/World.cs

 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using Microsoft.Xna.Framework;
 
 namespace GameProgram
 {
-  public class World
+  public class World : GameEntity
   {
     private StarSystem starSystem;
     private List<Party> parties = new List<Party>();
     //{
     //  throw new NotImplementedException();
     //}
+
+    public List<VisableGameEntity> getVisableGameEntities()
+    {
+      return getChildVisableGameEntities();
+    }
+
+    public override List<VisableGameEntity> getChildVisableGameEntities()
+    {
+      List<VisableGameEntity> visableGameEntities = new List<VisableGameEntity>();
+
+      visableGameEntities = starSystem.getChildVisableGameEntities();
+
+      return visableGameEntities;
+    }
+
+    public override void update( GameTime gameTime )
+    {
+      starSystem.update( gameTime );
+      
+      foreach (Party party in parties)
+      {
+        party.update( gameTime );
+      }
+      
+    }
   }
 }