MrScautHD / Sparkle

A fast, Cross-platform .NET 8 C# 12 game engine.
https://sparkle-engine.com
MIT License
105 stars 11 forks source link

Logo

Welcome to Sparkle 🎉

A fast, Cross-platform .NET 8 C# 12 game engine.

grafik

discord sponsor

🪙 Installation - Nuget

dotnet add package Sparkle --version 4.0.1

⭐ Getting Started

We trust you'll relish your time with Sparkle! To kick things off, head over to our Wiki for a seamless start.

📚 Libraries - Nuget

💻 Platforms

windows

Windows

Linux

Linux

macOS

MacOS

🧑 Contributors

🖥️ Basic Example

public class GameTest : Game {

    public Texture2D Texture;

    public GameTest(GameSettings settings) : base(settings) {

        // Create your own config file!
        JsonConfig config = new JsonConfigBuilder("config", "test")
            .Add("Hello", "Hello World!")
            .Add("Bye", 1000)
            .Build();

        Logger.Info(config.GetValue<string>("Hello"));
    }

    protected override void Init() {
        base.Init();
    }

    protected override void Load() {
        base.Load();

        // Load resources.
        this.Texture = this.Content.Load(new TextureContent("icon.png"));
    }

    protected override void Draw() {
        base.Draw();

        // Draw circle if "A" down.
        if (Input.IsKeyDown(KeyboardKey.A)) {
            ShapeHelper.DrawCircle(new Vector2(50, 50), 20, Color.Blue);
        }

        // Draw texture if "B" down.
        if (Input.IsKeyDown(KeyboardKey.B)) {
            Graphics.DrawTexture(this.Texture, Vector3.Zero, Color.White);
        }
    }
}

💸 Sponsors

Please consider SPONSOR me to further help development and to allow faster issue triaging and new features to be implemented.