Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.47 KB

README.MD

File metadata and controls

49 lines (38 loc) · 1.47 KB

logo

Nuget

A fork of Walgelijk. Een kleine, simpele 2D game engine which rids SixLabors dependencies with SkiaSharp.

var game = new Game(
	new OpenTKWindow("Videogame", new Vector2(-1), new Vector2(1280, 720)),
	new OpenALAudioRenderer()
);

game.UpdateRate = 120;
game.FixedUpdateRate = 60;
game.Window.VSync = false;

TextureLoader.Settings.FilterMode = FilterMode.Linear;

Resources.SetBasePathForType<FixedAudioData>("audio");
Resources.SetBasePathForType<StreamAudioData>("audio");
Resources.SetBasePathForType<Texture>("textures");
Resources.SetBasePathForType<Font>("fonts");

var scene = game.Scene = new Scene(game);
scene.AddSystem(new CameraSystem());
scene.AddSystem(new TransformSystem());
		
var camera = scene.CreateEntity();
scene.AttachComponent(camera, new TransformComponent());
scene.AttachComponent(camera, new CameraComponent
{
    PixelsPerUnit = 1,
    OrthographicSize = 1,
    ClearColour = new Color("#a8a3c1")
});

#if DEBUG
	game.DevelopmentMode = true;
	game.Console.DrawConsoleNotification = true;
#else
	game.DevelopmentMode = false;
	game.Console.DrawConsoleNotification = false;
#endif

game.Window.SetIcon(Resources.Load<Texture>("icon.png"));
game.Profiling.DrawQuickProfiler = false;

game.Start();