This is the main type for your game
Inheritance: Microsoft.Xna.Framework.Game
Beispiel #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
 public HelpScreen(Game1 game)
     : base(game)
 {
 }
 public AboutScreen(Game1 game)
     : base(game)
 {
 }
Beispiel #4
0
 /// <summary>
 /// This constructor uses the default x and y grid resolutions, and
 /// the midpoint as the player position.
 /// </summary>
 /// <param name="game">The containing game.</param>
 /// <param name="topLeft">Top left of the bounding rectangle.</param>
 /// <param name="bottomRight">Bottom right of the bounding rectangle.</param>
 public Level(Game1 game, Vector2 topLeft, Vector2 bottomRight)
     : this(game, topLeft, bottomRight, defaultXGridResolution, defaultYGridResolution)
 {
 }
Beispiel #5
0
        /// <summary>
        /// The full constructor.
        /// </summary>
        /// <param name="game">The containing game.</param>
        /// <param name="topLeft">Top left of the bounding rectangle.</param>
        /// <param name="bottomRight">Bottom right of the bounding rectangle.</param>
        /// <param name="playerPosition">The player's location.</param>
        /// <param name="xgr">X Grid Resolution</param>
        /// <param name="ygr">Y Grid Resolution</param>
        public Level(Game1 game, Vector2 topLeft, Vector2 bottomRight, Vector2 playerPosition, int xgr, int ygr)
        {
            this.game = game;
            this.Batch = game.spriteBatch;
            this.graphicsDevice = game.GraphicsDevice;

            Grid = new GridPosition[xgr, ygr];
            GridSize = new Vector2((bottomRight.X - topLeft.X) / xgr, (bottomRight.Y - topLeft.Y) / ygr);
            numRoadSquares = 0;

            this.TopLeft = topLeft;
            this.BottomRight = bottomRight;
            this.XGridResolution = xgr;
            this.YGridResolution = ygr;

            this.PlayerPosition = playerPosition;

            NewSpawners = new LinkedList<SpawnPoint>();
            ReadySpawners = new LinkedList<SpawnPoint>();

            updateBuffer = true;

            Towers = new List<Tower>();
            Creeps = new LinkedList<Creep>();
        }
Beispiel #6
0
 /// <summary>
 /// This constructor defaults the player position to the level's mid-point.
 /// </summary>
 /// <param name="game">The containing game.</param>
 /// <param name="topLeft">Top left of the bounding rectangle.</param>
 /// <param name="bottomRight">Bottom right of the bounding rectangle.</param>
 /// <param name="xgr">X Grid Resolution</param>
 /// <param name="ygr">Y Grid Resolution</param>
 public Level(Game1 game, Vector2 topLeft, Vector2 bottomRight, int xgr, int ygr)
     : this(game, topLeft, bottomRight, (topLeft + bottomRight) / 2.0f, xgr, ygr)
 {
 }
 public BlackScreen(Game1 game)
     : base(game)
 {
 }
 public AchievementsScreen(Game1 game)
     : base(game)
 {
 }
 public StartScreen(Game1 game)
     : base(game)
 {
 }
Beispiel #10
0
        public SpawnPoint(Game1 game, Vector2 startPosition, Vector2 finalPosition)
            : base(game)
        {
            this.game = game;
            this.Position = startPosition;
            this.ObjectTexture = GraphicsPool.Spawner;

            this.graphicsDevice = game.GraphicsDevice;

            this.ready = false;
            this.started = false;
            this.hasBeenChecked = false;

            WayPoints = new LinkedList<Link>();

            FinalPosition = finalPosition;

            //TODO: Does this comply with the new co-ordinate system...?
            Vector2 centerXY = TileSystem.LatLongToPixelXY(game.startingCoordinate, game.bingMapsViewer.ZoomLevel);

            GeoPosition = TileSystem.PixelXYToLatLong(centerXY + startPosition - finalPosition, game.bingMapsViewer.ZoomLevel);
            FinalGeoPosition = TileSystem.PixelXYToLatLong(centerXY, game.bingMapsViewer.ZoomLevel);

            effect = new BasicEffect(graphicsDevice);
            effect.VertexColorEnabled = true;
            effect.Alpha = 1f;
            effect.View = Matrix.Identity;
            effect.World = Matrix.Identity;
            effect.Projection = Matrix.CreateOrthographicOffCenter(0f, graphicsDevice.Viewport.Width,
                                    graphicsDevice.Viewport.Height, 0f, 0f, -1.0F);
        }
 public SplashScreen(Game1 game)
     : base(game)
 {
 }
 public ScoresScreen(Game1 game)
     : base(game)
 {
 }
Beispiel #13
0
 public Screen(Game1 game)
 {
     this.theGame = game;
 }
 public NewGameScreen(Game1 game)
     : base(game)
 {
 }
Beispiel #15
0
 public MainScreen(Game1 game)
     : base(game)
 {
 }
 public PlayingScreen(Game1 game)
     : base(game)
 {
 }