Giter VIP home page Giter VIP logo

bijington / orbit Goto Github PK

View Code? Open in Web Editor NEW
276.0 26.0 36.0 47.17 MB

The Orbit engine is a game engine built on top of .NET MAUI Graphics. The objective is to firstly enjoy the journey of building a game engine and secondly providing a framework that allows us to utilise the best parts of a cross-platform framework while building a 'typical' game.

C# 100.00%
dotnet-maui game-development game-engine

orbit's Introduction

Shaun Lawrence | Bijington | he/him

โ” Who I am

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง Father and Husband | ๐ŸŽฎ Gamer | ๐Ÿ“ฑ and ๐Ÿ’ป Software Engineer | Microsoft MVP

Shaun is an avid gamer, learner and experimenter, these combined with a profession in software development make for some really fun journeys. He gets more than excited when others find interest in what he does and has made it his mission to share his learnings and result of the experiments with anyone that will listen.

Father to two amazing children and many, many unfinished side projects.

Shaun is a Microsoft MVP, speaker and published author.

๐Ÿ” Where you can find me

๐Ÿง‘โ€๐Ÿ’ป What I work on

I am a huge lover of Open Source and help to maintain the following projects:

  • Expressive - Cross-platform expression parsing and evaluation framework. - GitHub stars
  • Orbit - A 2D game engine built on top of .NET MAUI Graphics. - GitHub stars
  • .NET MAUI Community Toolkit - A community-created library that contains .NET MAUI Extensions, Advanced UI/UX Controls, and Behaviors. - GitHub stars
  • Xamarin Community Toolkit - A collection of Animations, Behaviors, Converters, and Effects for mobile development with Xamarin.Forms. - GitHub stars

orbit's People

Contributors

bijington avatar frederisk avatar patrik64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orbit's Issues

Deployment and Usability

Hello all,

I'm migrating some of my games to MAUI and I'm looking for a Graphics engine to work on.

I was going to ask if Orbit is available as NuGet package and if this graphics library is free to use.

Also how is its performance and can we use 3D graphics.

What about inputs like touch and slides.

I'm having issues running the 3 tests found in the repo. Syntax error and deploy configuration error. Can we have a look at?

Cheers

Investigate the use of some level of snapshot testing

Something along the lines should work but we need to find a way to wrap it up nicely for use:

[Test]
public void SceneShouldRenderAsExpected()
{
    var scenery = new Scenery();
    var canvas = new SkiaCanvas();
    var bitmap = new SKBitmap(new SKImageInfo(1000, 1000));
    canvas.Canvas = new SKCanvas(bitmap);

    // Test our Render implementation
    scenery.Render(canvas, new Microsoft.Maui.Graphics.RectF(0, 0, 1000, 1000));

    using var stream = File.Create("snapshot.png");
    bitmap.Encode(stream, SKEncodedImageFormat.Png, 100);
}

public class Scenery : GameScene
{
    public override void Render(Canvas canvas, RectF dimensions)
    {
        base.Render(canvas, dimensions);

        canvas.FillColor = Colors.PaleGoldenrod;
        canvas.FillRectangle(new Rect(0, 0, 100, 100));
    }
}

This currently just involves a GameScene implementation that simply draws a rectangle on screen.

Exception thrown when loading an image on Windows

When invoking "new W2DImageLoadingService().FromStream(stream)" I see this exception:

System.Exception: 'No resource creator has been registered globally or for this thread.'

I found the following open issue:
IImageLoadingServcie cannot load image on Windows

The suggested workaround to connect a GlobalCreator after the GraphicsView is loaded partially solves this issue.

Exception will be thrown until the GraphicView "Loaded" handler workaround is invoked, so you would need to defer resource loading until after Loaded is triggered.

I used a Lazy to load the resources on the first Render call to the GameObject.

Originally posted by @aluitink in #4 (comment)

Investigate and add in better lifecycle support for game entities

Consider letting GameScene and GameObject know when child objects are added/removed. Also allow for objects to know when they have been added/removed.

And finally GameScene should know when it is loaded/unloaded.

Something like:

public class GameScene
{
    public void OnGameObjectAdded(IGameObject gameObject);

    public void OnGameObjectRemoved(IGameObject gameObject);

    public void OnLoaded();

    public void OnUnloaded();
}
public class GameObject
{
    public void OnGameObjectAdded(IGameObject gameObject);

    public void OnGameObjectRemoved(IGameObject gameObject);

    public void OnAdded(); // TODO: Parent?

    public void OnRemoved();
}

Really simple sample

Hi

Trying to teach my kids programming and I need really simple sample.

Something like:

https://www.ponggame.org/

Just few tasks:

  1. setup scene (MAUI template + Button click + 2nd page with "game")
  2. draw/render object[s]
  3. move/animate object[s]
  4. advanced (collision, logic, etc)

Is there something like that?

Thanks

Consider adding a image resource container to image load management

Are you considering to use an image resource container to manage the image load following the flyweight pattern?

I developed a first aproach in the following branch where you can see the idea. Following the flyweight pattern allow you save memory when you use the same image in several game objects.

If you think that this can be useful for the project, I can create a Pull Request to one of your branches.

Reorganise things

Given there are multiple game projects on the go along with the engine development I currently propose the following structure:

  • assets - any media for the repo/readme files
  • engine - the main source code for the engine + tests
  • games - the source code for multiple games - possibly one folder per game project to house tests and assets

Setup CI/CD pipeline

The pragmatic approach would be to make use of GitHub Actions given this is hosted on GitHub but Azure DevOps is another possible option

Investigate dynamic creation of scenes

Perhaps something like registering a scene name with the type so then when calling gameSceneManager.LoadScene the user could just pass in the name and have a new instance created.

Let's get physics all

Investigate some level of physics based functionality for the engine. This could either be as part of the main engine or a separate package.

First key functionality to address would be collision detection.

Investigate a need for Scoped lifetimes

Scoped lifetimes around the lifetime of a GameScene feels like it could have some merit. It shouldn't be the only way to use the system though and will require some investigation.

Perhaps some extension to the UseOrbitEngine to accept options like:

.UseOrbitEngine(options =>
{
    options.ScopedLifetimesByScene = true;
});

Find the best way to load images

Currently LoadImage is hard coded to load from a specific namespace, I would like to find a way to make this as easy to use but also consider avoiding things like Reflection to get there.

This should also result in adding docs to explain how it could be used.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.