41 lines
952 B
Zig
41 lines
952 B
Zig
allocator: std.mem.Allocator,
|
|
|
|
pub var NeonObjectTable: core.EngineObjectVTable = core.EngineObjectVTable.from(@This());
|
|
|
|
pub fn init(allocator: std.mem.Allocator) !*@This() {
|
|
const self = try allocator.create(@This());
|
|
self.* = .{
|
|
.allocator = allocator,
|
|
};
|
|
return self;
|
|
}
|
|
|
|
pub fn prepare_game(self: *@This()) !void {
|
|
_ = self;
|
|
try core.fs().addContentPath("sampleGame");
|
|
try script.loadTypes("scripts");
|
|
try script.runScriptFile("scripts/prepare.lua");
|
|
}
|
|
|
|
pub fn tick(self: *@This(), _: f64) void {
|
|
_ = self;
|
|
}
|
|
|
|
pub fn deinit(self: *@This()) void {
|
|
self.allocator.destroy(self);
|
|
}
|
|
|
|
pub fn main() anyerror!void {
|
|
try backlog.initializeAndRunStandardProgram(@This(), .{
|
|
.name = "Hello World",
|
|
.enabledModules = .{
|
|
.physics = true,
|
|
},
|
|
});
|
|
}
|
|
|
|
const std = @import("std");
|
|
const backlog = @import("Backlog");
|
|
const core = backlog.core;
|
|
const script = core.script;
|