A 2d game engine in JavaScript