Fix frame update logic and emulator support

- Fix basic1.cpp loop to handle set_frame_updates(true) correctly with sleep
- Update emulator loop for concurrent input and frame updates
- Update emulator for SFML 3.0 compatibility
- Add INPUT.FRAME_TICK constant to Lua bindings
- Enable frame updates in snake.lua example
This commit is contained in:
Adolfo Reyna
2026-02-10 23:27:31 -05:00
parent fe5d58b663
commit 47fc02f05c
5 changed files with 65 additions and 38 deletions

View File

@@ -236,6 +236,10 @@ static void register_input_constants(lua_State* L) {
lua_pushstring(L, "GESTURE");
lua_pushinteger(L, 6);
lua_settable(L, -3);
lua_pushstring(L, "FRAME_TICK");
lua_pushinteger(L, 7);
lua_settable(L, -3);
lua_setglobal(L, "INPUT");
}

View File

@@ -32,6 +32,9 @@ function init()
game.vars.frame_count = 0
game.vars.move_speed = 10 -- Frames between moves
-- Enable continuous frame updates
game.set_frame_updates(true)
print("Snake Game initialized")
end