A stealth-based 2D platformer where you don't have to kill anyone unless you want to. https://www.semicolin.games
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

68 lines
1.9 KiB

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System.Collections.Generic;
namespace Jumpy {
public class JumpyGame : Game {
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
SpriteFont font;
KeyboardInput keyboardInput = new KeyboardInput();
bool fullScreen = false;
IWindow window;
public JumpyGame() {
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
// Performs initialization that's needed before starting to run.
protected override void Initialize() {
window = (IWindow) Services.GetService(typeof(IWindow));
window.SetFullScreen(fullScreen, this, graphics);
base.Initialize();
}
// Called once per game. Loads all game content.
protected override void LoadContent() {
spriteBatch = new SpriteBatch(GraphicsDevice);
font = Content.Load<SpriteFont>("font");
}
// Called once per game. Unloads all game content.
protected override void UnloadContent() {
// TODO: Unload any non ContentManager content here.
}
// Updates the game world.
protected override void Update(GameTime gameTime) {
keyboardInput.Update();
List<Keys> keysDown = keyboardInput.NewKeysDown();
if (keysDown.Contains(Keys.F12)) {
window.SetFullScreen(!fullScreen, this, graphics);
fullScreen = !fullScreen;
}
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
keysDown.Contains(Keys.Escape)) {
Exit();
}
base.Update(gameTime);
}
// Called when the game should draw itself.
protected override void Draw(GameTime gameTime) {
GraphicsDevice.Clear(Color.CornflowerBlue);
spriteBatch.Begin();
spriteBatch.DrawString(font, "hello world", new Vector2(100, 100), Color.Black);
spriteBatch.End();
base.Draw(gameTime);
}
}
}