Download CommonLua/GameBase.lua from sirnii/myspace: direct link, hf CLI and curl.
- Browser
- Download file 602 Bytes
-
https://huggingface.co/spaces/sirnii/myspace/resolve/main/CommonLua/GameBase.lua
- Command line
-
hf download hf://spaces/sirnii/myspace/CommonLua/GameBase.lua
-
curl -L -o GameBase.lua https://huggingface.co/spaces/sirnii/myspace/resolve/main/CommonLua/GameBase.lua
602 Bytes
| -- base game functions needed for loading a map, moved from EditorGame.lua in order to detach the editor from the game | |
| function WaitNextFrame(count) | |
| local persistError = collectgarbage -- we reference a C function so trying to persist WaitNextFrame will result in an error | |
| local frame = GetRenderFrame() + (count or 1) | |
| while GetRenderFrame() - frame < 0 do | |
| WaitMsg("OnRender", 30) | |
| end | |
| end | |
| function WaitFramesOrSleepAtLeast(frames, ms) | |
| local end_frame = GetRenderFrame() + (frames or 1) | |
| local end_time = now() + ms | |
| while GetRenderFrame() < end_frame or now() < end_time do | |
| Sleep(1) | |
| end | |
| end |