Temporal changes

This commit is contained in:
Dusk 2023-10-01 15:28:18 +02:00
parent c2786fdceb
commit 9420ca82fe
4 changed files with 28 additions and 5 deletions

11
src/Config/controls.zig Normal file
View File

@ -0,0 +1,11 @@
@import("../input.zig");
fn loadControls() void {
}
fn createControls() void {
}
pub const controls = config.init("coso.ini")I

1
src/Game/Score.zig Normal file
View File

@ -0,0 +1 @@
const Score = @Type(u64);

View File

@ -1,4 +1,6 @@
const rl = @import("raylib.zig");
const std = @import("std");
const config = @import("Config/config.zig");
pub const Input = struct {
name: []const u8,
@ -24,6 +26,20 @@ fn init(comptime name: []const u8, comptime key_code: []const u8) Input {
};
}
pub fn loadConfig() void {
var configIterator = config.getConfigIterator("input.ini") catch {
// Error opening config
std.debug.print("Cannot load input.ini configuration file, using default keybindings\n");
return;
};
// while (configIterator.next()) |option| {
// }
configIterator.deinit();
}
pub var menu_right = init("Menu Right", "RIGHT");
pub var menu_left = init("Menu Left", "LEFT");
pub var menu_down = init("Menu Down", "DOWN");

View File

@ -11,11 +11,6 @@ const State = @import("flow.zig").State;
pub fn main() !void {
var configIterator = config.getConfigIterator("test") catch unreachable;
while (configIterator.next()) |option| {
std.debug.print("Key: {s}, Option: {s}\n", .{option.key, option.value});
}
configIterator.deinit();
var renderer = try Renderer.init();