diff --git a/Program.cs b/Program.cs index 250cfac..96c91e4 100644 --- a/Program.cs +++ b/Program.cs @@ -1,11 +1,12 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; namespace Barbs { - class Program : Game + class Program : Game, IDisposable { Texture2D ballTexture; private GraphicsDeviceManager graphics; @@ -51,6 +52,12 @@ namespace Barbs this.testLine.InitOnGraphicalDevice(GraphicsDevice); } + protected void Dispose() + { + //Cleanup + // OR Final call before shutdown + } + protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) @@ -82,8 +89,11 @@ namespace Barbs static void Main(string[] args) { - var pro = new Program(); - pro.Run(); + + using (Program game = new Program()) + { + game.Run(); + } } } } diff --git a/Screens/IScreen.cs b/Screens/IScreen.cs new file mode 100644 index 0000000..7b4130f --- /dev/null +++ b/Screens/IScreen.cs @@ -0,0 +1,9 @@ + +namespace MyGame.Screens +{ + public interface IScreen + { + void Update(); + void Draw(); + } +} diff --git a/Screens/MenuScreen.cs b/Screens/MenuScreen.cs new file mode 100644 index 0000000..a0681c0 --- /dev/null +++ b/Screens/MenuScreen.cs @@ -0,0 +1,15 @@ +namespace MyGame.Screens +{ + public class MenuScreen : IScreen + { + public void Update() + { + + } + + public void Draw() + { + + } + } +}