This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame1.cs
More file actions
57 lines (43 loc) · 1.36 KB
/
Copy pathGame1.cs
File metadata and controls
57 lines (43 loc) · 1.36 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
global using Microsoft.Xna.Framework;
global using Microsoft.Xna.Framework.Graphics;
using Minesharp.Graphics;
using Minesharp.Managers;
namespace Minesharp;
public class Game1 : Game
{
private GraphicsDeviceManager _graphics;
private GameManager _gameManager;
public Game1()
{
_graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
IsMouseVisible = false;
Window.TextInput += InputManager.OnTextInput;
}
protected override void Initialize()
{
Global.Content = Content;
Global.GameInstance = this;
GraphicsManager.SetScreenBounds(_graphics);
base.Initialize();
_gameManager = new(GraphicsDevice);
}
protected override void LoadContent()
{
Global.SpriteBatch = new SpriteBatch(GraphicsDevice);
Global.MCFontRegular = Content.Load<SpriteFont>("DebuggingTools\\minecraftRegular");
Global.MCFontBig = Content.Load<SpriteFont>("DebuggingTools\\minecraftBig");
TexturesManager.LoadAllTextures();
}
protected override void Update(GameTime gameTime)
{
_gameManager.Update();
Global.YieldDeltaTime(gameTime);
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
_gameManager.Draw(GraphicsDevice);
base.Draw(gameTime);
}
}