2011-10-31 05:36:24 +00:00
|
|
|
#region Using Statements
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using ANX.Framework;
|
|
|
|
using ANX.Framework.Graphics;
|
|
|
|
using ANX.Framework.Input;
|
|
|
|
#endregion // Using Statements
|
|
|
|
|
2012-08-09 09:45:04 +00:00
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
2011-10-31 05:36:24 +00:00
|
|
|
|
|
|
|
namespace WindowsGame1
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// This is the main type for your game
|
|
|
|
/// </summary>
|
|
|
|
public class Game1 : ANX.Framework.Game
|
|
|
|
{
|
|
|
|
GraphicsDeviceManager graphics;
|
|
|
|
SpriteBatch spriteBatch;
|
|
|
|
|
2011-12-06 09:11:26 +00:00
|
|
|
public Game1()
|
2011-10-31 05:36:24 +00:00
|
|
|
{
|
|
|
|
graphics = new GraphicsDeviceManager(this);
|
|
|
|
Content.RootDirectory = "SampleContent";
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Allows the game to perform any initialization it needs to before starting to run.
|
|
|
|
/// This is where it can query for any required services and load any non-graphic
|
|
|
|
/// related content. Calling base.Initialize will enumerate through any components
|
|
|
|
/// and initialize them as well.
|
|
|
|
/// </summary>
|
|
|
|
protected override void Initialize()
|
|
|
|
{
|
|
|
|
base.Initialize();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// LoadContent will be called once per game and is the place to load
|
|
|
|
/// all of your content.
|
|
|
|
/// </summary>
|
|
|
|
protected override void LoadContent()
|
|
|
|
{
|
|
|
|
// Create a new SpriteBatch, which can be used to draw textures.
|
2011-11-28 11:11:54 +00:00
|
|
|
spriteBatch = new SpriteBatch(GraphicsDevice);
|
2011-12-16 07:54:47 +00:00
|
|
|
}
|
2011-10-31 05:36:24 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// UnloadContent will be called once per game and is the place to unload
|
|
|
|
/// all content.
|
|
|
|
/// </summary>
|
|
|
|
protected override void UnloadContent()
|
|
|
|
{
|
2011-11-07 11:26:19 +00:00
|
|
|
|
|
|
|
}
|
2011-10-31 05:36:24 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Allows the game to run logic such as updating the world,
|
|
|
|
/// checking for collisions, gathering input, and playing audio.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
|
|
|
protected override void Update(GameTime gameTime)
|
|
|
|
{
|
|
|
|
// Allows the game to exit
|
2011-11-14 19:37:05 +00:00
|
|
|
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
|
2011-10-31 05:36:24 +00:00
|
|
|
{
|
|
|
|
this.Exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
base.Update(gameTime);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// This is called when the game should draw itself.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
|
|
|
protected override void Draw(GameTime gameTime)
|
|
|
|
{
|
|
|
|
GraphicsDevice.Clear(Color.CornflowerBlue);
|
|
|
|
|
|
|
|
base.Draw(gameTime);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|