Add screens
This commit is contained in:
18
Program.cs
18
Program.cs
@@ -1,11 +1,12 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
|
|
||||||
namespace Barbs
|
namespace Barbs
|
||||||
{
|
{
|
||||||
class Program : Game
|
class Program : Game, IDisposable
|
||||||
{
|
{
|
||||||
Texture2D ballTexture;
|
Texture2D ballTexture;
|
||||||
private GraphicsDeviceManager graphics;
|
private GraphicsDeviceManager graphics;
|
||||||
@@ -51,6 +52,12 @@ namespace Barbs
|
|||||||
this.testLine.InitOnGraphicalDevice(GraphicsDevice);
|
this.testLine.InitOnGraphicalDevice(GraphicsDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void Dispose()
|
||||||
|
{
|
||||||
|
//Cleanup
|
||||||
|
// OR Final call before shutdown
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update(GameTime gameTime)
|
protected override void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
|
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)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var pro = new Program();
|
|
||||||
pro.Run();
|
using (Program game = new Program())
|
||||||
|
{
|
||||||
|
game.Run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
9
Screens/IScreen.cs
Normal file
9
Screens/IScreen.cs
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
namespace MyGame.Screens
|
||||||
|
{
|
||||||
|
public interface IScreen
|
||||||
|
{
|
||||||
|
void Update();
|
||||||
|
void Draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
15
Screens/MenuScreen.cs
Normal file
15
Screens/MenuScreen.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
namespace MyGame.Screens
|
||||||
|
{
|
||||||
|
public class MenuScreen : IScreen
|
||||||
|
{
|
||||||
|
public void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Draw()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user