Speed library

This library helps you mainting a constant speed (FPS) in your game.

File:
Speed.lib
Version:
1.0
Author:
Marcus Johansson

Contents

Details
Sub routines


Details

This library contains two functions for maintaining a constant speed in games. Unless a game loop is timed, the speed will depend on the user's system.


Subroutines

Name
Parameters
Brief description
procedure
SPD_HoldFrame
maxFPS
Hold a maximum number of frames per second.
function
SPD_HoldFrameDraw
fps
Same as 'SPD_HoldFrame' but returns false if the game is running to slow.


Subroutine documentation

procedure SPD_HoldFrame ( maxFPS )

Call the procedure at the end of your game loop, and it will limit the speed by waiting.

Parameter
Mode
Description
maxFPS
In
Max FPS.

[ Back ]


function SPD_HoldFrameDraw ( fps )

This function works like 'SPD_HoldFrame' but returns false if the program is running too slow. In that case you can skip drawing the next frame and only update the logic.

Parameter
Mode
Description
fps
In
Max FPS.

Return value
False if fps is lower than 'fps'.

[ Back ]


Generated with NLDoc 20140630.