-
Notifications
You must be signed in to change notification settings - Fork 0
/
Reverie.cs
94 lines (74 loc) · 2.63 KB
/
Reverie.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using ReverieGame.Components;
using ReverieGame.Entities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using SharpDX.DXGI;
using System.Windows.Forms.VisualStyles;
using System;
using System.Net.NetworkInformation;
namespace ReverieGame
{
public class Reverie : Game
{
private GraphicsDeviceManager graphics;
private SpriteBatch spriteBatch;
private KeyboardState keyboardPrev = new KeyboardState();
private MouseState mousePrev = new MouseState();
private GamePadState gamePadPrev = new GamePadState();
private Texture2D texture;
private Player player;
private Stone stone;
public Reverie()
{
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = 1280;
graphics.PreferredBackBufferHeight = 720;
graphics.IsFullScreen = false;
graphics.SynchronizeWithVerticalRetrace = true;
Content.RootDirectory = "Content";
IsMouseVisible = true;
}
protected override void Initialize()
{
// TODO: Add your initialization logic here
player = new Player();
//stone = new Stone();
player.Initialise();
//stone.Initialise();
base.Initialize();
}
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
player.LoadContent(Content);
//stone.LoadContent(Content);
// TODO: use this.Content to load your game content here
}
protected override void UnloadContent()
{
spriteBatch.Dispose();
AnimatedSpriteSystem.DestroyAll();
}
protected override void Update(GameTime gameTime)
{
//if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
// Exit();
// TODO: Add your update logic here
ControllerSystem.Update(gameTime);
PhysicsSystem.Update(gameTime);
TransformSystem.Update(gameTime);
AnimatedSpriteSystem.Update(gameTime);
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
// TODO: Add your drawing code here
spriteBatch.Begin();
AnimatedSpriteSystem.Draw(spriteBatch);
spriteBatch.End();
base.Draw(gameTime);
}
}
}