Last active
October 7, 2016 10:45
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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