Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using Microsoft.Xna.Framework.Input;
- namespace MyGameTest
- {
- /// <summary>
- /// This is the main type for your game.
- /// </summary>
- public class MyTestGame : Game
- {
- private readonly GraphicsDeviceManager _graphicsDeviceManager;
- private readonly SceneManager _sceneManager;
- public ButtonicaGame()
- {
- _graphicsDeviceManager = new GraphicsDeviceManager(this);
- _sceneManager = new SceneManager(this);
- Content.RootDirectory = "Content";
- // register components
- Components.Add(_sceneManager);
- }
- protected override void Initialize()
- {
- base.Initialize();
- _sceneManager.ChangeScene(new TitleScene(this));
- }
- protected override void Update(GameTime gameTime)
- {
- if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
- Exit();
- base.Update(gameTime);
- }
- protected override void Draw(GameTime gameTime)
- {
- GraphicsDevice.Clear(Color.Black);
- base.Draw(gameTime);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement