Getting Started with CoreScript
CoreScript is a high-performance, developer-first C# game engine built on OpenTK. This guide will walk you through your first steps.
NOTE: CoreScript requires .NET 8.0 or higher, OpenTK 3.3.1, StbImageSharp 2.30.15, and NAudio to be installed in your project.
Project Setup
To begin, add a reference to the Engine.dll in your project. You can do this via your IDE's project properties or by editing the .csproj file directly.
// Example of how to initialize a game instance
using Engine;
using Engine.Rendering;
using OpenTK;
class Program
{
static void Main()
{
var core = new Core(800, 600, "Game");
core.Run(60.0); // 60 = FPS
}
}
The Core API
The Core class is the entry point for your game. It extends GameWindow from OpenTK and manages the game loop for you.
csharp
using Engine;
using OpenTK.Graphics;
using OpenTK;
var core = new Core(800, 600, "Game Title");
The Core constructor accepts:
- width - Window width in pixels
- height - Window height in pixels
- title - Window title string
NOTE:
Core.Instanceprovides static access to the currently running core instance.