littlejsengine
Version:
LittleJS - Tiny and Fast HTML5 Game Engine
30 lines (26 loc) • 683 B
JavaScript
function gameInit()
{
// called once after the engine starts up
// setup the game
}
function gameUpdate()
{
// called every frame at 60 frames per second
// handle input and update the game state
}
function gameUpdatePost()
{
// called after physics and objects are updated
// setup camera and prepare for render
}
function gameRender()
{
// called before objects are rendered
// draw any background effects that appear behind objects
}
function gameRenderPost()
{
// called after objects are rendered
// draw effects or hud that appear above all objects
drawTextOverlay('LittleJS Engine', vec2(0,6), 3);
}