1. Attributes

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

2. Methods

Method Description
new(o) constructor
update() updates and delays to attempt to maintain proper fps
set_fps(fps) sets the fps to fps

3. Usage

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