Skip to content
Mini Javascipt library for gamedev.
JavaScript
Find file
Latest commit b351603 @t4pczan Update README.md
Failed to load latest commit information.
LICENSE Initial commit
README.md Update README.md
gameloop.js Create gameloop.js

README.md

gameloop.js

Mini Javascipt library for gamedev.

Description

Just one simple function, which provides main game loop for your game.

Usage

gameloop(callback)

callback is a function, which takes one argument - time between two animation frames.

Simple example

gameloop(function (dt) {

//update logic, eg. move sprites
sprite.x += 100 * dt; //move sprite by 100 pixels per second

//draw everything
draw_game();

});

Something went wrong with that request. Please try again.