This is the main type for your game
Наследование: Microsoft.Xna.Framework.Game
Пример #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Пример #2
0
 public HelpScreen(Game1 game)
     : base(game)
 {
 }
Пример #3
0
 public AboutScreen(Game1 game)
     : base(game)
 {
 }
Пример #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)
 {
 }
Пример #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>();
        }
Пример #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)
 {
 }
Пример #7
0
 public BlackScreen(Game1 game)
     : base(game)
 {
 }
 public AchievementsScreen(Game1 game)
     : base(game)
 {
 }
Пример #9
0
 public StartScreen(Game1 game)
     : base(game)
 {
 }
Пример #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);
        }
Пример #11
0
 public SplashScreen(Game1 game)
     : base(game)
 {
 }
Пример #12
0
 public ScoresScreen(Game1 game)
     : base(game)
 {
 }
Пример #13
0
 public Screen(Game1 game)
 {
     this.theGame = game;
 }
Пример #14
0
 public NewGameScreen(Game1 game)
     : base(game)
 {
 }
Пример #15
0
 public MainScreen(Game1 game)
     : base(game)
 {
 }
Пример #16
0
 public PlayingScreen(Game1 game)
     : base(game)
 {
 }