Esempio n. 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Esempio n. 2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            instance = this;

            //time management
            IsFixedTimeStep = true;
            TargetElapsedTime = TimeSpan.FromSeconds(1.0f / FramePerSecond);

            //size of the board with respect to width and height multiplied by the width of the sprite
            boardSize = new Vector2(cellnoX, cellnoY) * cellSize;

            //setting the window screen to be the same size as the board size
            graphics.PreferredBackBufferWidth = (int)boardSize.X;
            graphics.PreferredBackBufferHeight = (int)boardSize.Y;
            graphics.ApplyChanges();

            IsMouseVisible = true;
        }
Esempio n. 3
0
 public void StartGame()
 {
     game = new Game1();
     game.Run();
 }