Advertisement
Guest User

Untitled

a guest
Dec 4th, 2015
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. using Microsoft.Xna.Framework;
  2. using Microsoft.Xna.Framework.Graphics;
  3. using Microsoft.Xna.Framework.Input;
  4.  
  5. namespace MyGameTest
  6. {
  7.     /// <summary>
  8.     /// This is the main type for your game.
  9.     /// </summary>
  10.     public class MyTestGame : Game
  11.     {
  12.  
  13.         private readonly GraphicsDeviceManager  _graphicsDeviceManager;
  14.         private readonly SceneManager           _sceneManager;
  15.        
  16.  
  17.         public ButtonicaGame()
  18.         {
  19.             _graphicsDeviceManager  = new GraphicsDeviceManager(this);
  20.             _sceneManager           = new SceneManager(this);
  21.             Content.RootDirectory   = "Content";
  22.  
  23.             // register components
  24.             Components.Add(_sceneManager);
  25.         }
  26.  
  27.         protected override void Initialize()
  28.         {
  29.             base.Initialize();
  30.  
  31.             _sceneManager.ChangeScene(new TitleScene(this));
  32.         }
  33.  
  34.        
  35.        
  36.         protected override void Update(GameTime gameTime)
  37.         {
  38.             if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
  39.                 Exit();
  40.  
  41.  
  42.             base.Update(gameTime);
  43.         }
  44.  
  45.         protected override void Draw(GameTime gameTime)
  46.         {
  47.             GraphicsDevice.Clear(Color.Black);
  48.  
  49.             base.Draw(gameTime);
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement