예제 #1
0
		/// <summary>
		/// Allows the game to perform any initialization it needs to before starting to run.
		/// This is where it can query for any required services and load any non-graphic
		/// related content.  Calling base.Initialize will enumerate through any components
		/// and initialize them as well.
		/// </summary>
		protected override void Initialize ()
		{
			base.Initialize ();

			this.graphics.PreferredBackBufferWidth = GraphicsDevice.DisplayMode.Width;
			this.graphics.PreferredBackBufferHeight = GraphicsDevice.DisplayMode.Height;
			this.graphics.IsFullScreen = false;

			this.graphics.ApplyChanges ();
			this.IsMouseVisible = true;

			this.status = new Status ();
			this.world = new World (this);
			this.ui = new UI (this);

            this.start = new Rectangle(Window.ClientBounds.Width - 300, Window.ClientBounds.Height - 102, 280, 82);
            this.tutorial = new Rectangle(10, Window.ClientBounds.Height - 102, 280, 82);

            int res1rx = (int)(Window.ClientBounds.Right - font.MeasureString(res1).X - 25);
            int res1ry = (int)(Window.ClientBounds.Top + 25);
            int res1w = (int)(font.MeasureString(res1).X);
            int res1h = (int)(font.MeasureString(res1).Y);
            this.res1R = new Rectangle(res1rx, res1ry, res1w, res1h);
            this.res2R = new Rectangle(res1rx, res1ry + res1h, res1w, res1h);
            this.res3R = new Rectangle(res1rx, res1ry + res1h * 2, res1w, res1h);

		}
예제 #2
0
		public void Restart ()
		{
			this.status = new Status ();
			this.world = new World (this);
			this.ui = new UI (this);
		}