diff --git a/apps/lua/game.c b/apps/lua/game.c index ceb0d27..abd2043 100644 --- a/apps/lua/game.c +++ b/apps/lua/game.c @@ -277,6 +277,11 @@ void game_tick(void) { /* pop package, package.searchers */ lua_pop(state->L, 2); + /* binding */ + lua_register(state->L, "sprite", b_sprite); + lua_register(state->L, "rectangle", b_rectangle); + lua_register(state->L, "text", b_text); + /* now finally get to running the code */ unsigned char *game_buf = NULL; int64_t game_buf_size = file_to_bytes("/scripts/game.lua", &game_buf); @@ -287,11 +292,6 @@ void game_tick(void) { } } /* from this point we have access to everything defined in lua */ - - /* binding */ - lua_register(state->L, "sprite", b_sprite); - lua_register(state->L, "rectangle", b_rectangle); - lua_register(state->L, "text", b_text); } State *state = ctx.udata;