A lightweight engine for HTML5 games