aleksandrresetnikov / Sparkle

A fast, Cross-platform .NET 7 C# 11 game engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo

Welcome to Sparkle πŸŽ‰

A fast, Cross-platform .NET 7 C# 11 game engine.

grafik

ko-fi

πŸͺ™ Installation - Nuget

dotnet add package Sparkle --version 1.0.0

πŸ“š Libraries (https://www.nuget.org/packages)

πŸŒ‹ Graphic Engine

πŸ’‘ Features

Audio Texture Model Font 3D Camera Material Overlay GUI Scene Entity Directed/Pointed Light Content Manager Config Physic

πŸ–₯️ Example

public class GameTest : Game {
    
    public GameTest(GameSettings settings, Scene scene) : base(settings, scene) {
        
        // Create your own config file!
        Config config = new ConfigBuilder("config", "test")
            .Add("Hello", "Hello World!")
            .Add("Bye", 1000)
            .Build();

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

    protected override void Init() {
        base.Init();
        
        // Simple logger.
        Logger.Debug("Debug text!");
        Logger.Info("Info text!");
        Logger.Warn("Warn text!");
        Logger.Error("Error text!");

        // Simple time.
        double deltaTime = Time.DeltaTime;
        double totalTime = Time.TotalTime;
        
        // Stop the time!
        Time.WaitTime(10);

        // Load resources.
        Texture2D texture = this.Content.Load<Texture2D>("icon.png");
        
        // Create your own Scene.
        SceneManager.SetScene(new TestScene("earth"));
        
        // Open a url.
        this.OpenURL("https://www.youtube.com/");
        
        // Take a screenshot
        this.Window.TakeScreenshot("path");
    }

    // Just runs when !Game.Headless [Support for servers!]
    protected override void Draw() {
        base.Draw();
        
        // Draw circle if "A" down and way more simple options to draw!
        if (Input.IsKeyDown(KeyboardKey.KEY_A)) {
            this.Graphics.ShapeRenderer.DrawCircle(new Vector2(50, 50), 20, Color.BLUE);
        }
    }
}

πŸ’Έ Sponsors

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

About

A fast, Cross-platform .NET 7 C# 11 game engine.

License:MIT License


Languages

Language:C# 100.0%