-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameImpl.cs
43 lines (33 loc) · 1.34 KB
/
GameImpl.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended.BitmapFonts;
namespace MineCifter {
public class GameImpl : Game {
public static GameImpl instance;
private SpriteBatch batch;
public Board Board;
public static BitmapFont font;
public Point LaunchArgs;
public GameImpl(int args0, int args1) {
this.LaunchArgs = new Point(args0, args1);
this.Content.RootDirectory = "Content";
new GraphicsDeviceManager(this) {
PreferredBackBufferWidth = (int) (this.LaunchArgs.X * Board.Scale),
PreferredBackBufferHeight = (int) (this.LaunchArgs.Y * Board.Scale)
};
this.IsMouseVisible = true;
}
protected override void LoadContent() {
this.batch = new SpriteBatch(this.GraphicsDevice);
this.Board = new Board(this.LaunchArgs);
font = this.Content.Load<BitmapFont>("font");
}
protected override void Draw(GameTime gameTime) {
this.GraphicsDevice.Clear(Color.CornflowerBlue);
this.Board.Draw(this.batch, this.GraphicsDevice.Viewport);
}
protected override void Update(GameTime gameTime) {
InputHandler.Update(this.Board, this);
}
}
}