Midnight Blue Game and Engine

MB2D (Midnight Blue engine for 2D) is a free and open source (MIT License) 2D game engine built on top of the fantastic MonoGame API. A general purpose engine intended for any genre of 2D game, MB2D is code-only and uses the MonoGame content pipeline for resource management.

Features

Getting Started

Right now, MB2D still has a dependency on MonoGame for spritebatching, content management, and some primitives so you'll need to download that and install on your system. Then download the MB2D DLL from ____ and add to your projects packages.

Everything in MB2D happens in Scenes which makes getting started with a game super easy - All you need is Main and a Scene.

First, create a new scene:

using MB2D.Scenes;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
namespace ExampleMB2D
{
// My first scene
public class HelloScene : Scene
{
// Initializes a new instance of the HelloScene class.
public HelloScene(EntityMap gameObjects, ContentManager content) : base(gameObjects, content)
{
}
// Runs any initialization logic and transitions until
// the transition state is changed
public override void Initialize()
{
// Required otherwise the initialize transition will never end
}
// Handles the input for the scene.
public override void HandleInput()
{
// all input logic should go here
}
// Updates the scene.
public override void Update()
{
// all game logic should happen here
}
// Draws the scene to the spriteBatch and uiSpriteBatch.
// spriteBatch - Sprite batch for world-based entities.
// uiSpriteBatch - User interface sprite batch for screen-based items
public override void Draw(SpriteBatch spriteBatch, SpriteBatch uiSpriteBatch)
{
// draw everything to the spriteBatch for world-based coordinates and to uiSpriteBatch for camera-based coordinates
}
// Exits the scene and runs any transitions until
// the transition state is changed. Once this transition
// finishes the scene will be gone for good.
public override void Exit()
{
// Required otherwise the exit transition will never end
}
// Pauses the scene and runs any transitions until
// the transition state is changed
public override void Pause()
{
// Required otherwise the pause transition will never end
}
// Resumes the scene and runs any transitions until
// the transition state is changed
public override void Resume()
{
// Required otherwise the resume transition will never end
}
}
}

Now define a Main entry point with a new MBGame class passing in the type of scene you want the game to start with, in this case HelloScene:

using MB2D;
namespace ExampleMB2D
{
static class ExampleMB2D
{
private static MBGame game;
static void Main(string[] args)
{
game = new MBGame(typeof(HelloScene));
game.Run();
game.Dispose(); // important to get rid of resources
}
}
}

And that's it! Use the MonoGame pipeline tool to import any resources needed, otherwise enjoy MB2D!


Midnight Blue

Explore the horizon in a procedurally generated galaxy consisting of thousands of star systems and hundreds of thousands of planets in your ship, the Midnight Blue.

The Game

Built initially as a showcase for MB2D, a code-only 2D game engine built on top of MonoGame, Midnight Blue is currently a top-down space simulation, with the ability to travel across the galaxy, traverse star systems, land on planets with varied biomes and explore them to an eerie synth opera soundtrack. However, the plans for the game are much greater with the following in the works:

License

The MIT License (MIT) Copyright (c) 2016 Jacob Milligan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.