Skip to content

Instantly share code, notes, and snippets.

@EvidentlyCube
Last active October 7, 2016 10:45
Show Gist options
  • Save EvidentlyCube/51dfdaf5609285241a9f812c9b8ee06b to your computer and use it in GitHub Desktop.
Save EvidentlyCube/51dfdaf5609285241a9f812c9b8ee06b to your computer and use it in GitHub Desktop.
Rewriting TN in MonoGame #1: Setting Up the Project - Bootstrap files - related post at: http://retrocade.net/2016/10/07/rewriting-tn-in-monogame-1-setting-up-the-project/
using System;
namespace TransNeuronica
{
//#if WINDOWS || LINUX // This conditional compilation is commented out because right now not all constants are correctly defined
// and we can't add our own in a simple fashion. I'll figure it out later
public static class Program
{
[STAThread]
static void Main()
{
using (var game = new TransNeuronica())
game.Run();
}
}
//#endif
}
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace TransNeuronica
{
public class TransNeuronica : Game
{
private GraphicsDeviceManager _graphics;
private SpriteBatch _spriteBatch;
public TransNeuronica()
{
_graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
protected override void Initialize()
{
base.Initialize();
}
protected override void LoadContent()
{
_spriteBatch = new SpriteBatch(GraphicsDevice);
}
protected override void UnloadContent()
{
}
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.CornflowerBlue);
base.Draw(gameTime);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment