fps = FPSManager:new() fps:set_fps(30) --main game loop while done ~= true do --game code goes here fps:update() end
Italics means private (in the sense that they shouldn't be set manually).
| Attribute | Description |
|---|---|
| delta | the delta from the previous frame |
| fps | the fps |
| time_per_frame | the time per frame |
| previous_frame | the time from the previous frame |
| Method | Description |
|---|---|
| new(o) | constructor |
| update() | updates and delays to attempt to maintain proper fps |
| set_fps(fps) | sets the fps to fps |
This class provides simple FPS management capabilities. It exists to promote cleaner code.
fps = FPSManager:new() fps:set_fps(30) --main game loop while done ~= true do --game code goes here fps:update() end