Lua, game state and game loop

前端 未结 9 1305
慢半拍i
慢半拍i 2021-01-31 10:13
  1. Call main.lua script at each game loop iteration - is it good or bad design? How does it affect on the performance (relatively)?

  2. Maintain game state fro

9条回答
  •  旧巷少年郎
    2021-01-31 10:30

    About the performance of 1: if main.lua does not change, load it once with lua_loadfile or loadfile, save a reference to the returned function, and then call it when needed.

提交回复
热议问题